2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3 * Copyright (C) 2009 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;
80 public AnnotationElement() {
91 public void deletePosition(
93 this._has_position= false;
98 public void deleteValue(
100 this._has_value= false;
104 * Returns the value of field 'description'.
106 * @return the value of field 'Description'.
108 public java.lang.String getDescription(
110 return this._description;
114 * Returns the value of field 'displayCharacter'.
116 * @return the value of field 'DisplayCharacter'.
118 public java.lang.String getDisplayCharacter(
120 return this._displayCharacter;
124 * Returns the value of field 'position'.
126 * @return the value of field 'Position'.
128 public int getPosition(
130 return this._position;
134 * Returns the value of field 'secondaryStructure'.
136 * @return the value of field 'SecondaryStructure'.
138 public java.lang.String getSecondaryStructure(
140 return this._secondaryStructure;
144 * Returns the value of field 'value'.
146 * @return the value of field 'Value'.
148 public float getValue(
154 * Method hasPosition.
156 * @return true if at least one Position has been added
158 public boolean hasPosition(
160 return this._has_position;
166 * @return true if at least one Value has been added
168 public boolean hasValue(
170 return this._has_value;
176 * @return true if this object is valid according to the schema
178 public boolean isValid(
182 } catch (org.exolab.castor.xml.ValidationException vex) {
192 * @throws org.exolab.castor.xml.MarshalException if object is
193 * null or if any SAXException is thrown during marshaling
194 * @throws org.exolab.castor.xml.ValidationException if this
195 * object is an invalid instance according to the schema
198 final java.io.Writer out)
199 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
200 Marshaller.marshal(this, out);
207 * @throws java.io.IOException if an IOException occurs during
209 * @throws org.exolab.castor.xml.ValidationException if this
210 * object is an invalid instance according to the schema
211 * @throws org.exolab.castor.xml.MarshalException if object is
212 * null or if any SAXException is thrown during marshaling
215 final org.xml.sax.ContentHandler handler)
216 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
217 Marshaller.marshal(this, handler);
221 * Sets the value of field 'description'.
223 * @param description the value of field 'description'.
225 public void setDescription(
226 final java.lang.String description) {
227 this._description = description;
231 * Sets the value of field 'displayCharacter'.
233 * @param displayCharacter the value of field 'displayCharacter'
235 public void setDisplayCharacter(
236 final java.lang.String displayCharacter) {
237 this._displayCharacter = displayCharacter;
241 * Sets the value of field 'position'.
243 * @param position the value of field 'position'.
245 public void setPosition(
246 final int position) {
247 this._position = position;
248 this._has_position = true;
252 * Sets the value of field 'secondaryStructure'.
254 * @param secondaryStructure the value of field
255 * 'secondaryStructure'.
257 public void setSecondaryStructure(
258 final java.lang.String secondaryStructure) {
259 this._secondaryStructure = secondaryStructure;
263 * Sets the value of field 'value'.
265 * @param value the value of field 'value'.
267 public void setValue(
270 this._has_value = true;
277 * @throws org.exolab.castor.xml.MarshalException if object is
278 * null or if any SAXException is thrown during marshaling
279 * @throws org.exolab.castor.xml.ValidationException if this
280 * object is an invalid instance according to the schema
281 * @return the unmarshaled jalview.binding.AnnotationElement
283 public static jalview.binding.AnnotationElement unmarshal(
284 final java.io.Reader reader)
285 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
286 return (jalview.binding.AnnotationElement) Unmarshaller.unmarshal(jalview.binding.AnnotationElement.class, reader);
292 * @throws org.exolab.castor.xml.ValidationException if this
293 * object is an invalid instance according to the schema
295 public void validate(
297 throws org.exolab.castor.xml.ValidationException {
298 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
299 validator.validate(this);