1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import org.exolab.castor.xml.Marshaller;
34 import org.exolab.castor.xml.Unmarshaller;
37 * Class AnnotationElement.
39 * @version $Revision$ $Date$
41 public class AnnotationElement implements java.io.Serializable
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
51 private int _position;
54 * keeps track of state for field: _position
56 private boolean _has_position;
64 * keeps track of state for field: _colour
66 private boolean _has_colour;
69 * Field _displayCharacter.
71 private java.lang.String _displayCharacter;
76 private java.lang.String _description;
79 * Field _secondaryStructure.
81 private java.lang.String _secondaryStructure;
89 * keeps track of state for field: _value
91 private boolean _has_value;
97 public AnnotationElement()
108 public void deleteColour()
110 this._has_colour = false;
115 public void deletePosition()
117 this._has_position = false;
122 public void deleteValue()
124 this._has_value = false;
128 * Returns the value of field 'colour'.
130 * @return the value of field 'Colour'.
132 public int getColour()
138 * Returns the value of field 'description'.
140 * @return the value of field 'Description'.
142 public java.lang.String getDescription()
144 return this._description;
148 * Returns the value of field 'displayCharacter'.
150 * @return the value of field 'DisplayCharacter'.
152 public java.lang.String getDisplayCharacter()
154 return this._displayCharacter;
158 * Returns the value of field 'position'.
160 * @return the value of field 'Position'.
162 public int getPosition()
164 return this._position;
168 * Returns the value of field 'secondaryStructure'.
170 * @return the value of field 'SecondaryStructure'.
172 public java.lang.String getSecondaryStructure()
174 return this._secondaryStructure;
178 * Returns the value of field 'value'.
180 * @return the value of field 'Value'.
182 public float getValue()
190 * @return true if at least one Colour has been added
192 public boolean hasColour()
194 return this._has_colour;
198 * Method hasPosition.
200 * @return true if at least one Position has been added
202 public boolean hasPosition()
204 return this._has_position;
210 * @return true if at least one Value has been added
212 public boolean hasValue()
214 return this._has_value;
220 * @return true if this object is valid according to the schema
222 public boolean isValid()
227 } catch (org.exolab.castor.xml.ValidationException vex)
238 * @throws org.exolab.castor.xml.MarshalException
239 * if object is null or if any SAXException is thrown during
241 * @throws org.exolab.castor.xml.ValidationException
242 * if this object is an invalid instance according to the schema
244 public void marshal(final java.io.Writer out)
245 throws org.exolab.castor.xml.MarshalException,
246 org.exolab.castor.xml.ValidationException
248 Marshaller.marshal(this, out);
255 * @throws java.io.IOException
256 * if an IOException occurs during marshaling
257 * @throws org.exolab.castor.xml.ValidationException
258 * if this object is an invalid instance according to the schema
259 * @throws org.exolab.castor.xml.MarshalException
260 * if object is null or if any SAXException is thrown during
263 public void marshal(final org.xml.sax.ContentHandler handler)
264 throws java.io.IOException,
265 org.exolab.castor.xml.MarshalException,
266 org.exolab.castor.xml.ValidationException
268 Marshaller.marshal(this, handler);
272 * Sets the value of field 'colour'.
275 * the value of field 'colour'.
277 public void setColour(final int colour)
279 this._colour = colour;
280 this._has_colour = true;
284 * Sets the value of field 'description'.
287 * the value of field 'description'.
289 public void setDescription(final java.lang.String description)
291 this._description = description;
295 * Sets the value of field 'displayCharacter'.
297 * @param displayCharacter
298 * the value of field 'displayCharacter'
300 public void setDisplayCharacter(final java.lang.String displayCharacter)
302 this._displayCharacter = displayCharacter;
306 * Sets the value of field 'position'.
309 * the value of field 'position'.
311 public void setPosition(final int position)
313 this._position = position;
314 this._has_position = true;
318 * Sets the value of field 'secondaryStructure'.
320 * @param secondaryStructure
321 * the value of field 'secondaryStructure'.
323 public void setSecondaryStructure(
324 final java.lang.String secondaryStructure)
326 this._secondaryStructure = secondaryStructure;
330 * Sets the value of field 'value'.
333 * the value of field 'value'.
335 public void setValue(final float value)
338 this._has_value = true;
345 * @throws org.exolab.castor.xml.MarshalException
346 * if object is null or if any SAXException is thrown during
348 * @throws org.exolab.castor.xml.ValidationException
349 * if this object is an invalid instance according to the schema
350 * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement
352 public static jalview.schemabinding.version2.AnnotationElement unmarshal(
353 final java.io.Reader reader)
354 throws org.exolab.castor.xml.MarshalException,
355 org.exolab.castor.xml.ValidationException
357 return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller
359 jalview.schemabinding.version2.AnnotationElement.class,
366 * @throws org.exolab.castor.xml.ValidationException
367 * if this object is an invalid instance according to the schema
369 public void validate() throws org.exolab.castor.xml.ValidationException
371 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
372 validator.validate(this);