2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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. If not, see <http://www.gnu.org/licenses/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.schemabinding.version2;
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
29 * Class AnnotationElement.
31 * @version $Revision$ $Date$
33 public class AnnotationElement implements java.io.Serializable
36 // --------------------------/
37 // - Class/Member Variables -/
38 // --------------------------/
43 private int _position;
46 * keeps track of state for field: _position
48 private boolean _has_position;
56 * keeps track of state for field: _colour
58 private boolean _has_colour;
61 * Field _displayCharacter.
63 private java.lang.String _displayCharacter;
68 private java.lang.String _description;
71 * Field _secondaryStructure.
73 private java.lang.String _secondaryStructure;
81 * keeps track of state for field: _value
83 private boolean _has_value;
89 public AnnotationElement()
100 public void deleteColour()
102 this._has_colour = false;
107 public void deletePosition()
109 this._has_position = false;
114 public void deleteValue()
116 this._has_value = false;
120 * Returns the value of field 'colour'.
122 * @return the value of field 'Colour'.
124 public int getColour()
130 * Returns the value of field 'description'.
132 * @return the value of field 'Description'.
134 public java.lang.String getDescription()
136 return this._description;
140 * Returns the value of field 'displayCharacter'.
142 * @return the value of field 'DisplayCharacter'.
144 public java.lang.String getDisplayCharacter()
146 return this._displayCharacter;
150 * Returns the value of field 'position'.
152 * @return the value of field 'Position'.
154 public int getPosition()
156 return this._position;
160 * Returns the value of field 'secondaryStructure'.
162 * @return the value of field 'SecondaryStructure'.
164 public java.lang.String getSecondaryStructure()
166 return this._secondaryStructure;
170 * Returns the value of field 'value'.
172 * @return the value of field 'Value'.
174 public float getValue()
182 * @return true if at least one Colour has been added
184 public boolean hasColour()
186 return this._has_colour;
190 * Method hasPosition.
192 * @return true if at least one Position has been added
194 public boolean hasPosition()
196 return this._has_position;
202 * @return true if at least one Value has been added
204 public boolean hasValue()
206 return this._has_value;
212 * @return true if this object is valid according to the schema
214 public boolean isValid()
219 } catch (org.exolab.castor.xml.ValidationException vex)
230 * @throws org.exolab.castor.xml.MarshalException
231 * if object is null or if any SAXException is thrown during
233 * @throws org.exolab.castor.xml.ValidationException
234 * if this object is an invalid instance according to the schema
236 public void marshal(final java.io.Writer out)
237 throws org.exolab.castor.xml.MarshalException,
238 org.exolab.castor.xml.ValidationException
240 Marshaller.marshal(this, out);
247 * @throws java.io.IOException
248 * if an IOException occurs during marshaling
249 * @throws org.exolab.castor.xml.ValidationException
250 * if this object is an invalid instance according to the schema
251 * @throws org.exolab.castor.xml.MarshalException
252 * if object is null or if any SAXException is thrown during
255 public void marshal(final org.xml.sax.ContentHandler handler)
256 throws java.io.IOException,
257 org.exolab.castor.xml.MarshalException,
258 org.exolab.castor.xml.ValidationException
260 Marshaller.marshal(this, handler);
264 * Sets the value of field 'colour'.
267 * the value of field 'colour'.
269 public void setColour(final int colour)
271 this._colour = colour;
272 this._has_colour = true;
276 * Sets the value of field 'description'.
279 * the value of field 'description'.
281 public void setDescription(final java.lang.String description)
283 this._description = description;
287 * Sets the value of field 'displayCharacter'.
289 * @param displayCharacter
290 * the value of field 'displayCharacter'
292 public void setDisplayCharacter(final java.lang.String displayCharacter)
294 this._displayCharacter = displayCharacter;
298 * Sets the value of field 'position'.
301 * the value of field 'position'.
303 public void setPosition(final int position)
305 this._position = position;
306 this._has_position = true;
310 * Sets the value of field 'secondaryStructure'.
312 * @param secondaryStructure
313 * the value of field 'secondaryStructure'.
315 public void setSecondaryStructure(
316 final java.lang.String secondaryStructure)
318 this._secondaryStructure = secondaryStructure;
322 * Sets the value of field 'value'.
325 * the value of field 'value'.
327 public void setValue(final float value)
330 this._has_value = true;
337 * @throws org.exolab.castor.xml.MarshalException
338 * if object is null or if any SAXException is thrown during
340 * @throws org.exolab.castor.xml.ValidationException
341 * if this object is an invalid instance according to the schema
342 * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement
344 public static jalview.schemabinding.version2.AnnotationElement unmarshal(
345 final java.io.Reader reader)
346 throws org.exolab.castor.xml.MarshalException,
347 org.exolab.castor.xml.ValidationException
349 return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller
351 jalview.schemabinding.version2.AnnotationElement.class,
358 * @throws org.exolab.castor.xml.ValidationException
359 * if this object is an invalid instance according to the schema
361 public void validate() throws org.exolab.castor.xml.ValidationException
363 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
364 validator.validate(this);