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;
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;
90 public void deleteBegin()
92 this._has_begin = false;
97 public void deleteEnd()
99 this._has_end = false;
103 * Returns the value of field 'begin'.
105 * @return the value of field 'Begin'.
107 public int getBegin()
113 * Returns the value of field 'description'.
115 * @return the value of field 'Description'.
117 public java.lang.String getDescription()
119 return this._description;
123 * Returns the value of field 'end'.
125 * @return the value of field 'End'.
133 * Returns the value of field 'status'.
135 * @return the value of field 'Status'.
137 public java.lang.String getStatus()
143 * Returns the value of field 'type'.
145 * @return the value of field 'Type'.
147 public java.lang.String getType()
155 * @return true if at least one Begin has been added
157 public boolean hasBegin()
159 return this._has_begin;
165 * @return true if at least one End has been added
167 public boolean hasEnd()
169 return this._has_end;
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 'begin'.
232 * the value of field 'begin'.
234 public void setBegin(final int begin)
237 this._has_begin = true;
241 * Sets the value of field 'description'.
244 * the value of field 'description'.
246 public void setDescription(final java.lang.String description)
248 this._description = description;
252 * Sets the value of field 'end'.
255 * the value of field 'end'.
257 public void setEnd(final int end)
260 this._has_end = true;
264 * Sets the value of field 'status'.
267 * the value of field 'status'.
269 public void setStatus(final java.lang.String status)
271 this._status = status;
275 * Sets the value of field 'type'.
278 * the value of field 'type'.
280 public void setType(final java.lang.String type)
289 * @throws org.exolab.castor.xml.MarshalException
290 * if object is null or if any SAXException is thrown during
292 * @throws org.exolab.castor.xml.ValidationException
293 * if this object is an invalid instance according to the
295 * @return the unmarshaled jalview.binding.Feature
297 public static jalview.binding.Feature unmarshal(
298 final java.io.Reader reader)
299 throws org.exolab.castor.xml.MarshalException,
300 org.exolab.castor.xml.ValidationException
302 return (jalview.binding.Feature) Unmarshaller.unmarshal(
303 jalview.binding.Feature.class, reader);
309 * @throws org.exolab.castor.xml.ValidationException
310 * if this object is an invalid instance according to the
313 public void validate() throws org.exolab.castor.xml.ValidationException
315 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
316 validator.validate(this);