licencing and format applied (eclipse)
[jalview.git] / src / jalview / schemabinding / version2 / JalviewModel.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)\r
3  * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle\r
4  * \r
5  * This program is free software; you can redistribute it and/or\r
6  * modify it under the terms of the GNU General Public License\r
7  * as published by the Free Software Foundation; either version 2\r
8  * of the License, or (at your option) any later version.\r
9  * \r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  * \r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program; if not, write to the Free Software\r
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA\r
18  */\r
19 package jalview.schemabinding.version2;\r
20 \r
21 // ---------------------------------/\r
22 // - Imported classes and packages -/\r
23 // ---------------------------------/\r
24 \r
25 import org.exolab.castor.xml.Marshaller;\r
26 import org.exolab.castor.xml.Unmarshaller;\r
27 \r
28 /**\r
29  * Class JalviewModel.\r
30  * \r
31  * @version $Revision$ $Date$\r
32  */\r
33 public class JalviewModel implements java.io.Serializable\r
34 {\r
35 \r
36   // --------------------------/\r
37   // - Class/Member Variables -/\r
38   // --------------------------/\r
39 \r
40   /**\r
41    * Field _creationDate.\r
42    */\r
43   private java.util.Date _creationDate;\r
44 \r
45   /**\r
46    * Field _version.\r
47    */\r
48   private java.lang.String _version;\r
49 \r
50   /**\r
51    * Field _vamsasModel.\r
52    */\r
53   private jalview.schemabinding.version2.VamsasModel _vamsasModel;\r
54 \r
55   /**\r
56    * Field _jalviewModelSequence.\r
57    */\r
58   private jalview.schemabinding.version2.JalviewModelSequence _jalviewModelSequence;\r
59 \r
60   // ----------------/\r
61   // - Constructors -/\r
62   // ----------------/\r
63 \r
64   public JalviewModel()\r
65   {\r
66     super();\r
67   }\r
68 \r
69   // -----------/\r
70   // - Methods -/\r
71   // -----------/\r
72 \r
73   /**\r
74    * Returns the value of field 'creationDate'.\r
75    * \r
76    * @return the value of field 'CreationDate'.\r
77    */\r
78   public java.util.Date getCreationDate()\r
79   {\r
80     return this._creationDate;\r
81   }\r
82 \r
83   /**\r
84    * Returns the value of field 'jalviewModelSequence'.\r
85    * \r
86    * @return the value of field 'JalviewModelSequence'.\r
87    */\r
88   public jalview.schemabinding.version2.JalviewModelSequence getJalviewModelSequence()\r
89   {\r
90     return this._jalviewModelSequence;\r
91   }\r
92 \r
93   /**\r
94    * Returns the value of field 'vamsasModel'.\r
95    * \r
96    * @return the value of field 'VamsasModel'.\r
97    */\r
98   public jalview.schemabinding.version2.VamsasModel getVamsasModel()\r
99   {\r
100     return this._vamsasModel;\r
101   }\r
102 \r
103   /**\r
104    * Returns the value of field 'version'.\r
105    * \r
106    * @return the value of field 'Version'.\r
107    */\r
108   public java.lang.String getVersion()\r
109   {\r
110     return this._version;\r
111   }\r
112 \r
113   /**\r
114    * Method isValid.\r
115    * \r
116    * @return true if this object is valid according to the schema\r
117    */\r
118   public boolean isValid()\r
119   {\r
120     try\r
121     {\r
122       validate();\r
123     } catch (org.exolab.castor.xml.ValidationException vex)\r
124     {\r
125       return false;\r
126     }\r
127     return true;\r
128   }\r
129 \r
130   /**\r
131    * \r
132    * \r
133    * @param out\r
134    * @throws org.exolab.castor.xml.MarshalException\r
135    *                 if object is null or if any SAXException is thrown during\r
136    *                 marshaling\r
137    * @throws org.exolab.castor.xml.ValidationException\r
138    *                 if this object is an invalid instance according to the\r
139    *                 schema\r
140    */\r
141   public void marshal(final java.io.Writer out)\r
142           throws org.exolab.castor.xml.MarshalException,\r
143           org.exolab.castor.xml.ValidationException\r
144   {\r
145     Marshaller.marshal(this, out);\r
146   }\r
147 \r
148   /**\r
149    * \r
150    * \r
151    * @param handler\r
152    * @throws java.io.IOException\r
153    *                 if an IOException occurs during marshaling\r
154    * @throws org.exolab.castor.xml.ValidationException\r
155    *                 if this object is an invalid instance according to the\r
156    *                 schema\r
157    * @throws org.exolab.castor.xml.MarshalException\r
158    *                 if object is null or if any SAXException is thrown during\r
159    *                 marshaling\r
160    */\r
161   public void marshal(final org.xml.sax.ContentHandler handler)\r
162           throws java.io.IOException,\r
163           org.exolab.castor.xml.MarshalException,\r
164           org.exolab.castor.xml.ValidationException\r
165   {\r
166     Marshaller.marshal(this, handler);\r
167   }\r
168 \r
169   /**\r
170    * Sets the value of field 'creationDate'.\r
171    * \r
172    * @param creationDate\r
173    *                the value of field 'creationDate'.\r
174    */\r
175   public void setCreationDate(final java.util.Date creationDate)\r
176   {\r
177     this._creationDate = creationDate;\r
178   }\r
179 \r
180   /**\r
181    * Sets the value of field 'jalviewModelSequence'.\r
182    * \r
183    * @param jalviewModelSequence\r
184    *                the value of field 'jalviewModelSequence'.\r
185    */\r
186   public void setJalviewModelSequence(\r
187           final jalview.schemabinding.version2.JalviewModelSequence jalviewModelSequence)\r
188   {\r
189     this._jalviewModelSequence = jalviewModelSequence;\r
190   }\r
191 \r
192   /**\r
193    * Sets the value of field 'vamsasModel'.\r
194    * \r
195    * @param vamsasModel\r
196    *                the value of field 'vamsasModel'.\r
197    */\r
198   public void setVamsasModel(\r
199           final jalview.schemabinding.version2.VamsasModel vamsasModel)\r
200   {\r
201     this._vamsasModel = vamsasModel;\r
202   }\r
203 \r
204   /**\r
205    * Sets the value of field 'version'.\r
206    * \r
207    * @param version\r
208    *                the value of field 'version'.\r
209    */\r
210   public void setVersion(final java.lang.String version)\r
211   {\r
212     this._version = version;\r
213   }\r
214 \r
215   /**\r
216    * Method unmarshal.\r
217    * \r
218    * @param reader\r
219    * @throws org.exolab.castor.xml.MarshalException\r
220    *                 if object is null or if any SAXException is thrown during\r
221    *                 marshaling\r
222    * @throws org.exolab.castor.xml.ValidationException\r
223    *                 if this object is an invalid instance according to the\r
224    *                 schema\r
225    * @return the unmarshaled jalview.schemabinding.version2.JalviewModel\r
226    */\r
227   public static jalview.schemabinding.version2.JalviewModel unmarshal(\r
228           final java.io.Reader reader)\r
229           throws org.exolab.castor.xml.MarshalException,\r
230           org.exolab.castor.xml.ValidationException\r
231   {\r
232     return (jalview.schemabinding.version2.JalviewModel) Unmarshaller\r
233             .unmarshal(jalview.schemabinding.version2.JalviewModel.class,\r
234                     reader);\r
235   }\r
236 \r
237   /**\r
238    * \r
239    * \r
240    * @throws org.exolab.castor.xml.ValidationException\r
241    *                 if this object is an invalid instance according to the\r
242    *                 schema\r
243    */\r
244   public void validate() throws org.exolab.castor.xml.ValidationException\r
245   {\r
246     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
247     validator.validate(this);\r
248   }\r
249 \r
250 }\r