2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $$Year-Rel$$ 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.
21 package jalview.binding;
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
27 import org.exolab.castor.xml.Marshaller;
28 import org.exolab.castor.xml.Unmarshaller;
31 * Class AnnotationElement.
33 * @version $Revision$ $Date$
35 public class AnnotationElement implements java.io.Serializable
38 // --------------------------/
39 // - Class/Member Variables -/
40 // --------------------------/
45 private int _position;
48 * keeps track of state for field: _position
50 private boolean _has_position;
53 * Field _displayCharacter.
55 private java.lang.String _displayCharacter;
60 private java.lang.String _description;
63 * Field _secondaryStructure.
65 private java.lang.String _secondaryStructure;
73 * keeps track of state for field: _value
75 private boolean _has_value;
81 public AnnotationElement()
92 public void deletePosition()
94 this._has_position = false;
99 public void deleteValue()
101 this._has_value = false;
105 * Returns the value of field 'description'.
107 * @return the value of field 'Description'.
109 public java.lang.String getDescription()
111 return this._description;
115 * Returns the value of field 'displayCharacter'.
117 * @return the value of field 'DisplayCharacter'.
119 public java.lang.String getDisplayCharacter()
121 return this._displayCharacter;
125 * Returns the value of field 'position'.
127 * @return the value of field 'Position'.
129 public int getPosition()
131 return this._position;
135 * Returns the value of field 'secondaryStructure'.
137 * @return the value of field 'SecondaryStructure'.
139 public java.lang.String getSecondaryStructure()
141 return this._secondaryStructure;
145 * Returns the value of field 'value'.
147 * @return the value of field 'Value'.
149 public float getValue()
155 * Method hasPosition.
157 * @return true if at least one Position has been added
159 public boolean hasPosition()
161 return this._has_position;
167 * @return true if at least one Value has been added
169 public boolean hasValue()
171 return this._has_value;
177 * @return true if this object is valid according to the schema
179 public boolean isValid()
184 } catch (org.exolab.castor.xml.ValidationException vex)
195 * @throws org.exolab.castor.xml.MarshalException
196 * if object is null or if any SAXException is thrown during
198 * @throws org.exolab.castor.xml.ValidationException
199 * if this object is an invalid instance according to the schema
201 public void marshal(final java.io.Writer out)
202 throws org.exolab.castor.xml.MarshalException,
203 org.exolab.castor.xml.ValidationException
205 Marshaller.marshal(this, out);
212 * @throws java.io.IOException
213 * if an IOException occurs during marshaling
214 * @throws org.exolab.castor.xml.ValidationException
215 * if this object is an invalid instance according to the schema
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 schema
295 * @return the unmarshaled jalview.binding.AnnotationElement
297 public static jalview.binding.AnnotationElement unmarshal(
298 final java.io.Reader reader)
299 throws org.exolab.castor.xml.MarshalException,
300 org.exolab.castor.xml.ValidationException
302 return (jalview.binding.AnnotationElement) Unmarshaller.unmarshal(
303 jalview.binding.AnnotationElement.class, reader);
309 * @throws org.exolab.castor.xml.ValidationException
310 * if this object is an invalid instance according to the schema
312 public void validate() throws org.exolab.castor.xml.ValidationException
314 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
315 validator.validate(this);