JAL-1432 updated copyright notices
[jalview.git] / src / jalview / binding / SequenceType.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
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.
10  *  
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.
15  * 
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.
18  */
19 package jalview.binding;
20
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
24
25 import org.exolab.castor.xml.Marshaller;
26 import org.exolab.castor.xml.Unmarshaller;
27
28 /**
29  * Class SequenceType.
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class SequenceType implements java.io.Serializable
34 {
35
36   // --------------------------/
37   // - Class/Member Variables -/
38   // --------------------------/
39
40   /**
41    * Field _id.
42    */
43   private java.lang.String _id;
44
45   /**
46    * Field _sequence.
47    */
48   private java.lang.String _sequence;
49
50   /**
51    * Field _name.
52    */
53   private java.lang.String _name;
54
55   // ----------------/
56   // - Constructors -/
57   // ----------------/
58
59   public SequenceType()
60   {
61     super();
62   }
63
64   // -----------/
65   // - Methods -/
66   // -----------/
67
68   /**
69    * Returns the value of field 'id'.
70    * 
71    * @return the value of field 'Id'.
72    */
73   public java.lang.String getId()
74   {
75     return this._id;
76   }
77
78   /**
79    * Returns the value of field 'name'.
80    * 
81    * @return the value of field 'Name'.
82    */
83   public java.lang.String getName()
84   {
85     return this._name;
86   }
87
88   /**
89    * Returns the value of field 'sequence'.
90    * 
91    * @return the value of field 'Sequence'.
92    */
93   public java.lang.String getSequence()
94   {
95     return this._sequence;
96   }
97
98   /**
99    * Method isValid.
100    * 
101    * @return true if this object is valid according to the schema
102    */
103   public boolean isValid()
104   {
105     try
106     {
107       validate();
108     } catch (org.exolab.castor.xml.ValidationException vex)
109     {
110       return false;
111     }
112     return true;
113   }
114
115   /**
116    * 
117    * 
118    * @param out
119    * @throws org.exolab.castor.xml.MarshalException
120    *           if object is null or if any SAXException is thrown during
121    *           marshaling
122    * @throws org.exolab.castor.xml.ValidationException
123    *           if this object is an invalid instance according to the schema
124    */
125   public void marshal(final java.io.Writer out)
126           throws org.exolab.castor.xml.MarshalException,
127           org.exolab.castor.xml.ValidationException
128   {
129     Marshaller.marshal(this, out);
130   }
131
132   /**
133    * 
134    * 
135    * @param handler
136    * @throws java.io.IOException
137    *           if an IOException occurs during marshaling
138    * @throws org.exolab.castor.xml.ValidationException
139    *           if this object is an invalid instance according to the schema
140    * @throws org.exolab.castor.xml.MarshalException
141    *           if object is null or if any SAXException is thrown during
142    *           marshaling
143    */
144   public void marshal(final org.xml.sax.ContentHandler handler)
145           throws java.io.IOException,
146           org.exolab.castor.xml.MarshalException,
147           org.exolab.castor.xml.ValidationException
148   {
149     Marshaller.marshal(this, handler);
150   }
151
152   /**
153    * Sets the value of field 'id'.
154    * 
155    * @param id
156    *          the value of field 'id'.
157    */
158   public void setId(final java.lang.String id)
159   {
160     this._id = id;
161   }
162
163   /**
164    * Sets the value of field 'name'.
165    * 
166    * @param name
167    *          the value of field 'name'.
168    */
169   public void setName(final java.lang.String name)
170   {
171     this._name = name;
172   }
173
174   /**
175    * Sets the value of field 'sequence'.
176    * 
177    * @param sequence
178    *          the value of field 'sequence'.
179    */
180   public void setSequence(final java.lang.String sequence)
181   {
182     this._sequence = sequence;
183   }
184
185   /**
186    * Method unmarshal.
187    * 
188    * @param reader
189    * @throws org.exolab.castor.xml.MarshalException
190    *           if object is null or if any SAXException is thrown during
191    *           marshaling
192    * @throws org.exolab.castor.xml.ValidationException
193    *           if this object is an invalid instance according to the schema
194    * @return the unmarshaled jalview.binding.SequenceType
195    */
196   public static jalview.binding.SequenceType unmarshal(
197           final java.io.Reader reader)
198           throws org.exolab.castor.xml.MarshalException,
199           org.exolab.castor.xml.ValidationException
200   {
201     return (jalview.binding.SequenceType) Unmarshaller.unmarshal(
202             jalview.binding.SequenceType.class, reader);
203   }
204
205   /**
206    * 
207    * 
208    * @throws org.exolab.castor.xml.ValidationException
209    *           if this object is an invalid instance according to the schema
210    */
211   public void validate() throws org.exolab.castor.xml.ValidationException
212   {
213     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
214     validator.validate(this);
215   }
216
217 }