2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5)
3 * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
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/>.
18 package jalview.binding;
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
30 * @version $Revision$ $Date$
32 public class Feature implements java.io.Serializable
35 // --------------------------/
36 // - Class/Member Variables -/
37 // --------------------------/
45 * keeps track of state for field: _begin
47 private boolean _has_begin;
55 * keeps track of state for field: _end
57 private boolean _has_end;
62 private java.lang.String _type;
67 private java.lang.String _description;
72 private java.lang.String _status;
89 public void deleteBegin()
91 this._has_begin = false;
96 public void deleteEnd()
98 this._has_end = false;
102 * Returns the value of field 'begin'.
104 * @return the value of field 'Begin'.
106 public int getBegin()
112 * Returns the value of field 'description'.
114 * @return the value of field 'Description'.
116 public java.lang.String getDescription()
118 return this._description;
122 * Returns the value of field 'end'.
124 * @return the value of field 'End'.
132 * Returns the value of field 'status'.
134 * @return the value of field 'Status'.
136 public java.lang.String getStatus()
142 * Returns the value of field 'type'.
144 * @return the value of field 'Type'.
146 public java.lang.String getType()
154 * @return true if at least one Begin has been added
156 public boolean hasBegin()
158 return this._has_begin;
164 * @return true if at least one End has been added
166 public boolean hasEnd()
168 return this._has_end;
174 * @return true if this object is valid according to the schema
176 public boolean isValid()
181 } catch (org.exolab.castor.xml.ValidationException vex)
192 * @throws org.exolab.castor.xml.MarshalException
193 * if object is null or if any SAXException is thrown during
195 * @throws org.exolab.castor.xml.ValidationException
196 * if this object is an invalid instance according to the schema
198 public void marshal(final java.io.Writer out)
199 throws org.exolab.castor.xml.MarshalException,
200 org.exolab.castor.xml.ValidationException
202 Marshaller.marshal(this, out);
209 * @throws java.io.IOException
210 * if an IOException occurs during marshaling
211 * @throws org.exolab.castor.xml.ValidationException
212 * if this object is an invalid instance according to the schema
213 * @throws org.exolab.castor.xml.MarshalException
214 * if object is null or if any SAXException is thrown during
217 public void marshal(final org.xml.sax.ContentHandler handler)
218 throws java.io.IOException,
219 org.exolab.castor.xml.MarshalException,
220 org.exolab.castor.xml.ValidationException
222 Marshaller.marshal(this, handler);
226 * Sets the value of field 'begin'.
229 * the value of field 'begin'.
231 public void setBegin(final int begin)
234 this._has_begin = true;
238 * Sets the value of field 'description'.
241 * the value of field 'description'.
243 public void setDescription(final java.lang.String description)
245 this._description = description;
249 * Sets the value of field 'end'.
252 * the value of field 'end'.
254 public void setEnd(final int end)
257 this._has_end = true;
261 * Sets the value of field 'status'.
264 * the value of field 'status'.
266 public void setStatus(final java.lang.String status)
268 this._status = status;
272 * Sets the value of field 'type'.
275 * the value of field 'type'.
277 public void setType(final java.lang.String type)
286 * @throws org.exolab.castor.xml.MarshalException
287 * if object is null or if any SAXException is thrown during
289 * @throws org.exolab.castor.xml.ValidationException
290 * if this object is an invalid instance according to the schema
291 * @return the unmarshaled jalview.binding.Feature
293 public static jalview.binding.Feature unmarshal(
294 final java.io.Reader reader)
295 throws org.exolab.castor.xml.MarshalException,
296 org.exolab.castor.xml.ValidationException
298 return (jalview.binding.Feature) Unmarshaller.unmarshal(
299 jalview.binding.Feature.class, reader);
305 * @throws org.exolab.castor.xml.ValidationException
306 * if this object is an invalid instance according to the schema
308 public void validate() throws org.exolab.castor.xml.ValidationException
310 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
311 validator.validate(this);