9042ae48186931e2f85fef27b7e9b982e1047c8f
[jalview.git] / src / jalview / schemabinding / version2 / JalviewModel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3  * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle
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  */
18 package jalview.schemabinding.version2;
19
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
23
24 import org.exolab.castor.xml.Marshaller;
25 import org.exolab.castor.xml.Unmarshaller;
26
27 /**
28  * Class JalviewModel.
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class JalviewModel implements java.io.Serializable
33 {
34
35   // --------------------------/
36   // - Class/Member Variables -/
37   // --------------------------/
38
39   /**
40    * Field _creationDate.
41    */
42   private java.util.Date _creationDate;
43
44   /**
45    * Field _version.
46    */
47   private java.lang.String _version;
48
49   /**
50    * Field _vamsasModel.
51    */
52   private jalview.schemabinding.version2.VamsasModel _vamsasModel;
53
54   /**
55    * Field _jalviewModelSequence.
56    */
57   private jalview.schemabinding.version2.JalviewModelSequence _jalviewModelSequence;
58
59   // ----------------/
60   // - Constructors -/
61   // ----------------/
62
63   public JalviewModel()
64   {
65     super();
66   }
67
68   // -----------/
69   // - Methods -/
70   // -----------/
71
72   /**
73    * Returns the value of field 'creationDate'.
74    * 
75    * @return the value of field 'CreationDate'.
76    */
77   public java.util.Date getCreationDate()
78   {
79     return this._creationDate;
80   }
81
82   /**
83    * Returns the value of field 'jalviewModelSequence'.
84    * 
85    * @return the value of field 'JalviewModelSequence'.
86    */
87   public jalview.schemabinding.version2.JalviewModelSequence getJalviewModelSequence()
88   {
89     return this._jalviewModelSequence;
90   }
91
92   /**
93    * Returns the value of field 'vamsasModel'.
94    * 
95    * @return the value of field 'VamsasModel'.
96    */
97   public jalview.schemabinding.version2.VamsasModel getVamsasModel()
98   {
99     return this._vamsasModel;
100   }
101
102   /**
103    * Returns the value of field 'version'.
104    * 
105    * @return the value of field 'Version'.
106    */
107   public java.lang.String getVersion()
108   {
109     return this._version;
110   }
111
112   /**
113    * Method isValid.
114    * 
115    * @return true if this object is valid according to the schema
116    */
117   public boolean isValid()
118   {
119     try
120     {
121       validate();
122     } catch (org.exolab.castor.xml.ValidationException vex)
123     {
124       return false;
125     }
126     return true;
127   }
128
129   /**
130    * 
131    * 
132    * @param out
133    * @throws org.exolab.castor.xml.MarshalException
134    *           if object is null or if any SAXException is thrown during
135    *           marshaling
136    * @throws org.exolab.castor.xml.ValidationException
137    *           if this object is an invalid instance according to the schema
138    */
139   public void marshal(final java.io.Writer out)
140           throws org.exolab.castor.xml.MarshalException,
141           org.exolab.castor.xml.ValidationException
142   {
143     Marshaller.marshal(this, out);
144   }
145
146   /**
147    * 
148    * 
149    * @param handler
150    * @throws java.io.IOException
151    *           if an IOException occurs during marshaling
152    * @throws org.exolab.castor.xml.ValidationException
153    *           if this object is an invalid instance according to the schema
154    * @throws org.exolab.castor.xml.MarshalException
155    *           if object is null or if any SAXException is thrown during
156    *           marshaling
157    */
158   public void marshal(final org.xml.sax.ContentHandler handler)
159           throws java.io.IOException,
160           org.exolab.castor.xml.MarshalException,
161           org.exolab.castor.xml.ValidationException
162   {
163     Marshaller.marshal(this, handler);
164   }
165
166   /**
167    * Sets the value of field 'creationDate'.
168    * 
169    * @param creationDate
170    *          the value of field 'creationDate'.
171    */
172   public void setCreationDate(final java.util.Date creationDate)
173   {
174     this._creationDate = creationDate;
175   }
176
177   /**
178    * Sets the value of field 'jalviewModelSequence'.
179    * 
180    * @param jalviewModelSequence
181    *          the value of field 'jalviewModelSequence'.
182    */
183   public void setJalviewModelSequence(
184           final jalview.schemabinding.version2.JalviewModelSequence jalviewModelSequence)
185   {
186     this._jalviewModelSequence = jalviewModelSequence;
187   }
188
189   /**
190    * Sets the value of field 'vamsasModel'.
191    * 
192    * @param vamsasModel
193    *          the value of field 'vamsasModel'.
194    */
195   public void setVamsasModel(
196           final jalview.schemabinding.version2.VamsasModel vamsasModel)
197   {
198     this._vamsasModel = vamsasModel;
199   }
200
201   /**
202    * Sets the value of field 'version'.
203    * 
204    * @param version
205    *          the value of field 'version'.
206    */
207   public void setVersion(final java.lang.String version)
208   {
209     this._version = version;
210   }
211
212   /**
213    * Method unmarshal.
214    * 
215    * @param reader
216    * @throws org.exolab.castor.xml.MarshalException
217    *           if object is null or if any SAXException is thrown during
218    *           marshaling
219    * @throws org.exolab.castor.xml.ValidationException
220    *           if this object is an invalid instance according to the schema
221    * @return the unmarshaled jalview.schemabinding.version2.JalviewModel
222    */
223   public static jalview.schemabinding.version2.JalviewModel unmarshal(
224           final java.io.Reader reader)
225           throws org.exolab.castor.xml.MarshalException,
226           org.exolab.castor.xml.ValidationException
227   {
228     return (jalview.schemabinding.version2.JalviewModel) Unmarshaller
229             .unmarshal(jalview.schemabinding.version2.JalviewModel.class,
230                     reader);
231   }
232
233   /**
234    * 
235    * 
236    * @throws org.exolab.castor.xml.ValidationException
237    *           if this object is an invalid instance according to the schema
238    */
239   public void validate() throws org.exolab.castor.xml.ValidationException
240   {
241     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
242     validator.validate(this);
243   }
244
245 }