2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3 * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
19 package jalview.binding;
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;
51 * Field _displayCharacter.
53 private java.lang.String _displayCharacter;
58 private java.lang.String _description;
61 * Field _secondaryStructure.
63 private java.lang.String _secondaryStructure;
71 * keeps track of state for field: _value
73 private boolean _has_value;
79 public AnnotationElement()
90 public void deletePosition()
92 this._has_position = false;
97 public void deleteValue()
99 this._has_value = false;
103 * Returns the value of field 'description'.
105 * @return the value of field 'Description'.
107 public java.lang.String getDescription()
109 return this._description;
113 * Returns the value of field 'displayCharacter'.
115 * @return the value of field 'DisplayCharacter'.
117 public java.lang.String getDisplayCharacter()
119 return this._displayCharacter;
123 * Returns the value of field 'position'.
125 * @return the value of field 'Position'.
127 public int getPosition()
129 return this._position;
133 * Returns the value of field 'secondaryStructure'.
135 * @return the value of field 'SecondaryStructure'.
137 public java.lang.String getSecondaryStructure()
139 return this._secondaryStructure;
143 * Returns the value of field 'value'.
145 * @return the value of field 'Value'.
147 public float getValue()
153 * Method hasPosition.
155 * @return true if at least one Position has been added
157 public boolean hasPosition()
159 return this._has_position;
165 * @return true if at least one Value has been added
167 public boolean hasValue()
169 return this._has_value;
175 * @return true if this object is valid according to the schema
177 public boolean isValid()
182 } catch (org.exolab.castor.xml.ValidationException vex)
193 * @throws org.exolab.castor.xml.MarshalException
194 * if object is null or if any SAXException is thrown during
196 * @throws org.exolab.castor.xml.ValidationException
197 * if this object is an invalid instance according to the
200 public void marshal(final java.io.Writer out)
201 throws org.exolab.castor.xml.MarshalException,
202 org.exolab.castor.xml.ValidationException
204 Marshaller.marshal(this, out);
211 * @throws java.io.IOException
212 * if an IOException occurs during marshaling
213 * @throws org.exolab.castor.xml.ValidationException
214 * if this object is an invalid instance according to the
216 * @throws org.exolab.castor.xml.MarshalException
217 * if object is null or if any SAXException is thrown during
220 public void marshal(final org.xml.sax.ContentHandler handler)
221 throws java.io.IOException,
222 org.exolab.castor.xml.MarshalException,
223 org.exolab.castor.xml.ValidationException
225 Marshaller.marshal(this, handler);
229 * Sets the value of field 'description'.
232 * the value of field 'description'.
234 public void setDescription(final java.lang.String description)
236 this._description = description;
240 * Sets the value of field 'displayCharacter'.
242 * @param displayCharacter
243 * the value of field 'displayCharacter'
245 public void setDisplayCharacter(final java.lang.String displayCharacter)
247 this._displayCharacter = displayCharacter;
251 * Sets the value of field 'position'.
254 * the value of field 'position'.
256 public void setPosition(final int position)
258 this._position = position;
259 this._has_position = true;
263 * Sets the value of field 'secondaryStructure'.
265 * @param secondaryStructure
266 * the value of field 'secondaryStructure'.
268 public void setSecondaryStructure(
269 final java.lang.String secondaryStructure)
271 this._secondaryStructure = secondaryStructure;
275 * Sets the value of field 'value'.
278 * the value of field 'value'.
280 public void setValue(final float value)
283 this._has_value = true;
290 * @throws org.exolab.castor.xml.MarshalException
291 * if object is null or if any SAXException is thrown during
293 * @throws org.exolab.castor.xml.ValidationException
294 * if this object is an invalid instance according to the
296 * @return the unmarshaled jalview.binding.AnnotationElement
298 public static jalview.binding.AnnotationElement unmarshal(
299 final java.io.Reader reader)
300 throws org.exolab.castor.xml.MarshalException,
301 org.exolab.castor.xml.ValidationException
303 return (jalview.binding.AnnotationElement) Unmarshaller.unmarshal(
304 jalview.binding.AnnotationElement.class, reader);
310 * @throws org.exolab.castor.xml.ValidationException
311 * if this object is an invalid instance according to the
314 public void validate() throws org.exolab.castor.xml.ValidationException
316 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
317 validator.validate(this);