1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $(date) 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.
20 *******************************************************************************/
22 * This class was automatically generated with
23 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
28 package jalview.schemabinding.version2;
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
34 import org.exolab.castor.xml.Marshaller;
35 import org.exolab.castor.xml.Unmarshaller;
38 * Class AnnotationElement.
40 * @version $Revision$ $Date$
42 public class AnnotationElement implements java.io.Serializable
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
52 private int _position;
55 * keeps track of state for field: _position
57 private boolean _has_position;
65 * keeps track of state for field: _colour
67 private boolean _has_colour;
70 * Field _displayCharacter.
72 private java.lang.String _displayCharacter;
77 private java.lang.String _description;
80 * Field _secondaryStructure.
82 private java.lang.String _secondaryStructure;
90 * keeps track of state for field: _value
92 private boolean _has_value;
98 public AnnotationElement()
109 public void deleteColour()
111 this._has_colour = false;
116 public void deletePosition()
118 this._has_position = false;
123 public void deleteValue()
125 this._has_value = false;
129 * Returns the value of field 'colour'.
131 * @return the value of field 'Colour'.
133 public int getColour()
139 * Returns the value of field 'description'.
141 * @return the value of field 'Description'.
143 public java.lang.String getDescription()
145 return this._description;
149 * Returns the value of field 'displayCharacter'.
151 * @return the value of field 'DisplayCharacter'.
153 public java.lang.String getDisplayCharacter()
155 return this._displayCharacter;
159 * Returns the value of field 'position'.
161 * @return the value of field 'Position'.
163 public int getPosition()
165 return this._position;
169 * Returns the value of field 'secondaryStructure'.
171 * @return the value of field 'SecondaryStructure'.
173 public java.lang.String getSecondaryStructure()
175 return this._secondaryStructure;
179 * Returns the value of field 'value'.
181 * @return the value of field 'Value'.
183 public float getValue()
191 * @return true if at least one Colour has been added
193 public boolean hasColour()
195 return this._has_colour;
199 * Method hasPosition.
201 * @return true if at least one Position has been added
203 public boolean hasPosition()
205 return this._has_position;
211 * @return true if at least one Value has been added
213 public boolean hasValue()
215 return this._has_value;
221 * @return true if this object is valid according to the schema
223 public boolean isValid()
228 } catch (org.exolab.castor.xml.ValidationException vex)
239 * @throws org.exolab.castor.xml.MarshalException
240 * if object is null or if any SAXException is thrown during
242 * @throws org.exolab.castor.xml.ValidationException
243 * if this object is an invalid instance according to the schema
245 public void marshal(final java.io.Writer out)
246 throws org.exolab.castor.xml.MarshalException,
247 org.exolab.castor.xml.ValidationException
249 Marshaller.marshal(this, out);
256 * @throws java.io.IOException
257 * if an IOException occurs during marshaling
258 * @throws org.exolab.castor.xml.ValidationException
259 * if this object is an invalid instance according to the schema
260 * @throws org.exolab.castor.xml.MarshalException
261 * if object is null or if any SAXException is thrown during
264 public void marshal(final org.xml.sax.ContentHandler handler)
265 throws java.io.IOException,
266 org.exolab.castor.xml.MarshalException,
267 org.exolab.castor.xml.ValidationException
269 Marshaller.marshal(this, handler);
273 * Sets the value of field 'colour'.
276 * the value of field 'colour'.
278 public void setColour(final int colour)
280 this._colour = colour;
281 this._has_colour = true;
285 * Sets the value of field 'description'.
288 * the value of field 'description'.
290 public void setDescription(final java.lang.String description)
292 this._description = description;
296 * Sets the value of field 'displayCharacter'.
298 * @param displayCharacter
299 * the value of field 'displayCharacter'
301 public void setDisplayCharacter(final java.lang.String displayCharacter)
303 this._displayCharacter = displayCharacter;
307 * Sets the value of field 'position'.
310 * the value of field 'position'.
312 public void setPosition(final int position)
314 this._position = position;
315 this._has_position = true;
319 * Sets the value of field 'secondaryStructure'.
321 * @param secondaryStructure
322 * the value of field 'secondaryStructure'.
324 public void setSecondaryStructure(
325 final java.lang.String secondaryStructure)
327 this._secondaryStructure = secondaryStructure;
331 * Sets the value of field 'value'.
334 * the value of field 'value'.
336 public void setValue(final float value)
339 this._has_value = true;
346 * @throws org.exolab.castor.xml.MarshalException
347 * if object is null or if any SAXException is thrown during
349 * @throws org.exolab.castor.xml.ValidationException
350 * if this object is an invalid instance according to the schema
351 * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement
353 public static jalview.schemabinding.version2.AnnotationElement unmarshal(
354 final java.io.Reader reader)
355 throws org.exolab.castor.xml.MarshalException,
356 org.exolab.castor.xml.ValidationException
358 return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller
360 jalview.schemabinding.version2.AnnotationElement.class,
367 * @throws org.exolab.castor.xml.ValidationException
368 * if this object is an invalid instance according to the schema
370 public void validate() throws org.exolab.castor.xml.ValidationException
372 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
373 validator.validate(this);