2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, 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.binding;
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;
50 * Field _displayCharacter.
52 private java.lang.String _displayCharacter;
57 private java.lang.String _description;
60 * Field _secondaryStructure.
62 private java.lang.String _secondaryStructure;
70 * keeps track of state for field: _value
72 private boolean _has_value;
78 public AnnotationElement()
89 public void deletePosition()
91 this._has_position = false;
96 public void deleteValue()
98 this._has_value = false;
102 * Returns the value of field 'description'.
104 * @return the value of field 'Description'.
106 public java.lang.String getDescription()
108 return this._description;
112 * Returns the value of field 'displayCharacter'.
114 * @return the value of field 'DisplayCharacter'.
116 public java.lang.String getDisplayCharacter()
118 return this._displayCharacter;
122 * Returns the value of field 'position'.
124 * @return the value of field 'Position'.
126 public int getPosition()
128 return this._position;
132 * Returns the value of field 'secondaryStructure'.
134 * @return the value of field 'SecondaryStructure'.
136 public java.lang.String getSecondaryStructure()
138 return this._secondaryStructure;
142 * Returns the value of field 'value'.
144 * @return the value of field 'Value'.
146 public float getValue()
152 * Method hasPosition.
154 * @return true if at least one Position has been added
156 public boolean hasPosition()
158 return this._has_position;
164 * @return true if at least one Value has been added
166 public boolean hasValue()
168 return this._has_value;
174 * @return true if this object is valid according to the schema
176 public boolean isValid()
181 } catch (org.exolab.castor.xml.ValidationException vex)
192 * @throws org.exolab.castor.xml.MarshalException
193 * if object is null or if any SAXException is thrown during
195 * @throws org.exolab.castor.xml.ValidationException
196 * if this object is an invalid instance according to the schema
198 public void marshal(final java.io.Writer out)
199 throws org.exolab.castor.xml.MarshalException,
200 org.exolab.castor.xml.ValidationException
202 Marshaller.marshal(this, out);
209 * @throws java.io.IOException
210 * if an IOException occurs during marshaling
211 * @throws org.exolab.castor.xml.ValidationException
212 * if this object is an invalid instance according to the schema
213 * @throws org.exolab.castor.xml.MarshalException
214 * if object is null or if any SAXException is thrown during
217 public void marshal(final org.xml.sax.ContentHandler handler)
218 throws java.io.IOException,
219 org.exolab.castor.xml.MarshalException,
220 org.exolab.castor.xml.ValidationException
222 Marshaller.marshal(this, handler);
226 * Sets the value of field 'description'.
229 * the value of field 'description'.
231 public void setDescription(final java.lang.String description)
233 this._description = description;
237 * Sets the value of field 'displayCharacter'.
239 * @param displayCharacter
240 * the value of field 'displayCharacter'
242 public void setDisplayCharacter(final java.lang.String displayCharacter)
244 this._displayCharacter = displayCharacter;
248 * Sets the value of field 'position'.
251 * the value of field 'position'.
253 public void setPosition(final int position)
255 this._position = position;
256 this._has_position = true;
260 * Sets the value of field 'secondaryStructure'.
262 * @param secondaryStructure
263 * the value of field 'secondaryStructure'.
265 public void setSecondaryStructure(
266 final java.lang.String secondaryStructure)
268 this._secondaryStructure = secondaryStructure;
272 * Sets the value of field 'value'.
275 * the value of field 'value'.
277 public void setValue(final float value)
280 this._has_value = true;
287 * @throws org.exolab.castor.xml.MarshalException
288 * if object is null or if any SAXException is thrown during
290 * @throws org.exolab.castor.xml.ValidationException
291 * if this object is an invalid instance according to the schema
292 * @return the unmarshaled jalview.binding.AnnotationElement
294 public static jalview.binding.AnnotationElement unmarshal(
295 final java.io.Reader reader)
296 throws org.exolab.castor.xml.MarshalException,
297 org.exolab.castor.xml.ValidationException
299 return (jalview.binding.AnnotationElement) Unmarshaller.unmarshal(
300 jalview.binding.AnnotationElement.class, reader);
306 * @throws org.exolab.castor.xml.ValidationException
307 * if this object is an invalid instance according to the schema
309 public void validate() throws org.exolab.castor.xml.ValidationException
311 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
312 validator.validate(this);