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;
31 * @version $Revision$ $Date$
33 public class Feature implements java.io.Serializable {
36 //--------------------------/
37 //- Class/Member Variables -/
38 //--------------------------/
46 * keeps track of state for field: _begin
48 private boolean _has_begin;
56 * keeps track of state for field: _end
58 private boolean _has_end;
63 private java.lang.String _type;
68 private java.lang.String _description;
73 private java.lang.String _status;
91 public void deleteBegin(
93 this._has_begin= false;
98 public void deleteEnd(
100 this._has_end= false;
104 * Returns the value of field 'begin'.
106 * @return the value of field 'Begin'.
114 * Returns the value of field 'description'.
116 * @return the value of field 'Description'.
118 public java.lang.String getDescription(
120 return this._description;
124 * Returns the value of field 'end'.
126 * @return the value of field 'End'.
134 * Returns the value of field 'status'.
136 * @return the value of field 'Status'.
138 public java.lang.String getStatus(
144 * Returns the value of field 'type'.
146 * @return the value of field 'Type'.
148 public java.lang.String getType(
156 * @return true if at least one Begin has been added
158 public boolean hasBegin(
160 return this._has_begin;
166 * @return true if at least one End has been added
168 public boolean hasEnd(
170 return this._has_end;
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 'begin'.
223 * @param begin the value of field 'begin'.
225 public void setBegin(
228 this._has_begin = true;
232 * Sets the value of field 'description'.
234 * @param description the value of field 'description'.
236 public void setDescription(
237 final java.lang.String description) {
238 this._description = description;
242 * Sets the value of field 'end'.
244 * @param end the value of field 'end'.
249 this._has_end = true;
253 * Sets the value of field 'status'.
255 * @param status the value of field 'status'.
257 public void setStatus(
258 final java.lang.String status) {
259 this._status = status;
263 * Sets the value of field 'type'.
265 * @param type the value of field 'type'.
268 final java.lang.String type) {
276 * @throws org.exolab.castor.xml.MarshalException if object is
277 * null or if any SAXException is thrown during marshaling
278 * @throws org.exolab.castor.xml.ValidationException if this
279 * object is an invalid instance according to the schema
280 * @return the unmarshaled jalview.binding.Feature
282 public static jalview.binding.Feature unmarshal(
283 final java.io.Reader reader)
284 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
285 return (jalview.binding.Feature) Unmarshaller.unmarshal(jalview.binding.Feature.class, reader);
291 * @throws org.exolab.castor.xml.ValidationException if this
292 * object is an invalid instance according to the schema
294 public void validate(
296 throws org.exolab.castor.xml.ValidationException {
297 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
298 validator.validate(this);