2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3 * Copyright (C) 2014 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 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/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
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 schema
199 public void marshal(final java.io.Writer out)
200 throws org.exolab.castor.xml.MarshalException,
201 org.exolab.castor.xml.ValidationException
203 Marshaller.marshal(this, out);
210 * @throws java.io.IOException
211 * if an IOException occurs during marshaling
212 * @throws org.exolab.castor.xml.ValidationException
213 * if this object is an invalid instance according to the schema
214 * @throws org.exolab.castor.xml.MarshalException
215 * if object is null or if any SAXException is thrown during
218 public void marshal(final org.xml.sax.ContentHandler handler)
219 throws java.io.IOException,
220 org.exolab.castor.xml.MarshalException,
221 org.exolab.castor.xml.ValidationException
223 Marshaller.marshal(this, handler);
227 * Sets the value of field 'description'.
230 * the value of field 'description'.
232 public void setDescription(final java.lang.String description)
234 this._description = description;
238 * Sets the value of field 'displayCharacter'.
240 * @param displayCharacter
241 * the value of field 'displayCharacter'
243 public void setDisplayCharacter(final java.lang.String displayCharacter)
245 this._displayCharacter = displayCharacter;
249 * Sets the value of field 'position'.
252 * the value of field 'position'.
254 public void setPosition(final int position)
256 this._position = position;
257 this._has_position = true;
261 * Sets the value of field 'secondaryStructure'.
263 * @param secondaryStructure
264 * the value of field 'secondaryStructure'.
266 public void setSecondaryStructure(
267 final java.lang.String secondaryStructure)
269 this._secondaryStructure = secondaryStructure;
273 * Sets the value of field 'value'.
276 * the value of field 'value'.
278 public void setValue(final float value)
281 this._has_value = true;
288 * @throws org.exolab.castor.xml.MarshalException
289 * if object is null or if any SAXException is thrown during
291 * @throws org.exolab.castor.xml.ValidationException
292 * if this object is an invalid instance according to the schema
293 * @return the unmarshaled jalview.binding.AnnotationElement
295 public static jalview.binding.AnnotationElement unmarshal(
296 final java.io.Reader reader)
297 throws org.exolab.castor.xml.MarshalException,
298 org.exolab.castor.xml.ValidationException
300 return (jalview.binding.AnnotationElement) Unmarshaller.unmarshal(
301 jalview.binding.AnnotationElement.class, reader);
307 * @throws org.exolab.castor.xml.ValidationException
308 * if this object is an invalid instance according to the schema
310 public void validate() throws org.exolab.castor.xml.ValidationException
312 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
313 validator.validate(this);