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