2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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/>.
18 package jalview.schemabinding.version2;
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
28 * Class AnnotationElement.
30 * @version $Revision$ $Date$
32 public class AnnotationElement implements java.io.Serializable
35 // --------------------------/
36 // - Class/Member Variables -/
37 // --------------------------/
42 private int _position;
45 * keeps track of state for field: _position
47 private boolean _has_position;
55 * keeps track of state for field: _colour
57 private boolean _has_colour;
60 * Field _displayCharacter.
62 private java.lang.String _displayCharacter;
67 private java.lang.String _description;
70 * Field _secondaryStructure.
72 private java.lang.String _secondaryStructure;
80 * keeps track of state for field: _value
82 private boolean _has_value;
88 public AnnotationElement()
99 public void deleteColour()
101 this._has_colour = false;
106 public void deletePosition()
108 this._has_position = false;
113 public void deleteValue()
115 this._has_value = false;
119 * Returns the value of field 'colour'.
121 * @return the value of field 'Colour'.
123 public int getColour()
129 * Returns the value of field 'description'.
131 * @return the value of field 'Description'.
133 public java.lang.String getDescription()
135 return this._description;
139 * Returns the value of field 'displayCharacter'.
141 * @return the value of field 'DisplayCharacter'.
143 public java.lang.String getDisplayCharacter()
145 return this._displayCharacter;
149 * Returns the value of field 'position'.
151 * @return the value of field 'Position'.
153 public int getPosition()
155 return this._position;
159 * Returns the value of field 'secondaryStructure'.
161 * @return the value of field 'SecondaryStructure'.
163 public java.lang.String getSecondaryStructure()
165 return this._secondaryStructure;
169 * Returns the value of field 'value'.
171 * @return the value of field 'Value'.
173 public float getValue()
181 * @return true if at least one Colour has been added
183 public boolean hasColour()
185 return this._has_colour;
189 * Method hasPosition.
191 * @return true if at least one Position has been added
193 public boolean hasPosition()
195 return this._has_position;
201 * @return true if at least one Value has been added
203 public boolean hasValue()
205 return this._has_value;
211 * @return true if this object is valid according to the schema
213 public boolean isValid()
218 } catch (org.exolab.castor.xml.ValidationException vex)
229 * @throws org.exolab.castor.xml.MarshalException
230 * if object is null or if any SAXException is thrown during
232 * @throws org.exolab.castor.xml.ValidationException
233 * if this object is an invalid instance according to the schema
235 public void marshal(final java.io.Writer out)
236 throws org.exolab.castor.xml.MarshalException,
237 org.exolab.castor.xml.ValidationException
239 Marshaller.marshal(this, out);
246 * @throws java.io.IOException
247 * if an IOException occurs during marshaling
248 * @throws org.exolab.castor.xml.ValidationException
249 * if this object is an invalid instance according to the schema
250 * @throws org.exolab.castor.xml.MarshalException
251 * if object is null or if any SAXException is thrown during
254 public void marshal(final org.xml.sax.ContentHandler handler)
255 throws java.io.IOException,
256 org.exolab.castor.xml.MarshalException,
257 org.exolab.castor.xml.ValidationException
259 Marshaller.marshal(this, handler);
263 * Sets the value of field 'colour'.
266 * the value of field 'colour'.
268 public void setColour(final int colour)
270 this._colour = colour;
271 this._has_colour = true;
275 * Sets the value of field 'description'.
278 * the value of field 'description'.
280 public void setDescription(final java.lang.String description)
282 this._description = description;
286 * Sets the value of field 'displayCharacter'.
288 * @param displayCharacter
289 * the value of field 'displayCharacter'
291 public void setDisplayCharacter(final java.lang.String displayCharacter)
293 this._displayCharacter = displayCharacter;
297 * Sets the value of field 'position'.
300 * the value of field 'position'.
302 public void setPosition(final int position)
304 this._position = position;
305 this._has_position = true;
309 * Sets the value of field 'secondaryStructure'.
311 * @param secondaryStructure
312 * the value of field 'secondaryStructure'.
314 public void setSecondaryStructure(
315 final java.lang.String secondaryStructure)
317 this._secondaryStructure = secondaryStructure;
321 * Sets the value of field 'value'.
324 * the value of field 'value'.
326 public void setValue(final float value)
329 this._has_value = true;
336 * @throws org.exolab.castor.xml.MarshalException
337 * if object is null or if any SAXException is thrown during
339 * @throws org.exolab.castor.xml.ValidationException
340 * if this object is an invalid instance according to the schema
341 * @return the unmarshaled jalview.schemabinding.version2.AnnotationElement
343 public static jalview.schemabinding.version2.AnnotationElement unmarshal(
344 final java.io.Reader reader)
345 throws org.exolab.castor.xml.MarshalException,
346 org.exolab.castor.xml.ValidationException
348 return (jalview.schemabinding.version2.AnnotationElement) Unmarshaller
350 jalview.schemabinding.version2.AnnotationElement.class,
357 * @throws org.exolab.castor.xml.ValidationException
358 * if this object is an invalid instance according to the schema
360 public void validate() throws org.exolab.castor.xml.ValidationException
362 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
363 validator.validate(this);