2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
21 package jalview.schemabinding.version2;
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
31 * Class AnnotationElement.
33 * @version $Revision$ $Date$
35 public class AnnotationElement implements java.io.Serializable
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
45 private int _position;
48 * keeps track of state for field: _position
50 private boolean _has_position;
58 * keeps track of state for field: _colour
60 private boolean _has_colour;
63 * Field _displayCharacter.
65 private java.lang.String _displayCharacter;
70 private java.lang.String _description;
73 * Field _secondaryStructure.
75 private java.lang.String _secondaryStructure;
83 * keeps track of state for field: _value
85 private boolean _has_value;
91 public AnnotationElement()
102 public void deleteColour()
104 this._has_colour = false;
109 public void deletePosition()
111 this._has_position = false;
116 public void deleteValue()
118 this._has_value = false;
122 * Returns the value of field 'colour'.
124 * @return the value of field 'Colour'.
126 public int getColour()
132 * Returns the value of field 'description'.
134 * @return the value of field 'Description'.
136 public java.lang.String getDescription()
138 return this._description;
142 * Returns the value of field 'displayCharacter'.
144 * @return the value of field 'DisplayCharacter'.
146 public java.lang.String getDisplayCharacter()
148 return this._displayCharacter;
152 * Returns the value of field 'position'.
154 * @return the value of field 'Position'.
156 public int getPosition()
158 return this._position;
162 * Returns the value of field 'secondaryStructure'.
164 * @return the value of field 'SecondaryStructure'.
166 public java.lang.String getSecondaryStructure()
168 return this._secondaryStructure;
172 * Returns the value of field 'value'.
174 * @return the value of field 'Value'.
176 public float getValue()
184 * @return true if at least one Colour has been added
186 public boolean hasColour()
188 return this._has_colour;
192 * Method hasPosition.
194 * @return true if at least one Position has been added
196 public boolean hasPosition()
198 return this._has_position;
204 * @return true if at least one Value has been added
206 public boolean hasValue()
208 return this._has_value;
214 * @return true if this object is valid according to the schema
216 public boolean isValid()
221 } catch (org.exolab.castor.xml.ValidationException vex)
232 * @throws org.exolab.castor.xml.MarshalException
233 * if object is null or if any SAXException is thrown during
235 * @throws org.exolab.castor.xml.ValidationException
236 * if this object is an invalid instance according to the schema
238 public void marshal(final java.io.Writer out)
239 throws org.exolab.castor.xml.MarshalException,
240 org.exolab.castor.xml.ValidationException
242 Marshaller.marshal(this, out);
249 * @throws java.io.IOException
250 * if an IOException occurs during marshaling
251 * @throws org.exolab.castor.xml.ValidationException
252 * if this object is an invalid instance according to the schema
253 * @throws org.exolab.castor.xml.MarshalException
254 * if object is null or if any SAXException is thrown during
257 public void marshal(final org.xml.sax.ContentHandler handler)
258 throws java.io.IOException,
259 org.exolab.castor.xml.MarshalException,
260 org.exolab.castor.xml.ValidationException
262 Marshaller.marshal(this, handler);
266 * Sets the value of field 'colour'.
269 * the value of field 'colour'.
271 public void setColour(final int colour)
273 this._colour = colour;
274 this._has_colour = true;
278 * Sets the value of field 'description'.
281 * the value of field 'description'.
283 public void setDescription(final java.lang.String description)
285 this._description = description;
289 * Sets the value of field 'displayCharacter'.
291 * @param displayCharacter
292 * the value of field 'displayCharacter'
294 public void setDisplayCharacter(final java.lang.String displayCharacter)
296 this._displayCharacter = displayCharacter;
300 * Sets the value of field 'position'.
303 * the value of field 'position'.
305 public void setPosition(final int position)
307 this._position = position;
308 this._has_position = true;
312 * Sets the value of field 'secondaryStructure'.
314 * @param secondaryStructure
315 * the value of field 'secondaryStructure'.
317 public void setSecondaryStructure(
318 final java.lang.String secondaryStructure)
320 this._secondaryStructure = secondaryStructure;
324 * Sets the value of field 'value'.
327 * the value of field 'value'.
329 public void setValue(final float value)
332 this._has_value = true;
339 * @throws org.exolab.castor.xml.MarshalException
340 * if object is null or if any SAXException is thrown during
342 * @throws org.exolab.castor.xml.ValidationException
343 * if this object is an invalid instance according to the schema
344 * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement
346 public static jalview.schemabinding.version2.AnnotationElement unmarshal(
347 final java.io.Reader reader)
348 throws org.exolab.castor.xml.MarshalException,
349 org.exolab.castor.xml.ValidationException
351 return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller
353 jalview.schemabinding.version2.AnnotationElement.class,
360 * @throws org.exolab.castor.xml.ValidationException
361 * if this object is an invalid instance according to the schema
363 public void validate() throws org.exolab.castor.xml.ValidationException
365 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
366 validator.validate(this);