9dbc5a5540f05949097345c4e57a9a7c1bed20ef
[jalview.git] / src / jalview / binding / JalviewModel.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 JalviewModel.
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class JalviewModel implements java.io.Serializable
34 {
35
36   // --------------------------/
37   // - Class/Member Variables -/
38   // --------------------------/
39
40   /**
41    * Field _creationDate.
42    */
43   private java.util.Date _creationDate;
44
45   /**
46    * Field _version.
47    */
48   private java.lang.String _version;
49
50   /**
51    * Field _vamsasModel.
52    */
53   private jalview.binding.VamsasModel _vamsasModel;
54
55   /**
56    * Field _jalviewModelSequence.
57    */
58   private jalview.binding.JalviewModelSequence _jalviewModelSequence;
59
60   // ----------------/
61   // - Constructors -/
62   // ----------------/
63
64   public JalviewModel()
65   {
66     super();
67   }
68
69   // -----------/
70   // - Methods -/
71   // -----------/
72
73   /**
74    * Returns the value of field 'creationDate'.
75    * 
76    * @return the value of field 'CreationDate'.
77    */
78   public java.util.Date getCreationDate()
79   {
80     return this._creationDate;
81   }
82
83   /**
84    * Returns the value of field 'jalviewModelSequence'.
85    * 
86    * @return the value of field 'JalviewModelSequence'.
87    */
88   public jalview.binding.JalviewModelSequence getJalviewModelSequence()
89   {
90     return this._jalviewModelSequence;
91   }
92
93   /**
94    * Returns the value of field 'vamsasModel'.
95    * 
96    * @return the value of field 'VamsasModel'.
97    */
98   public jalview.binding.VamsasModel getVamsasModel()
99   {
100     return this._vamsasModel;
101   }
102
103   /**
104    * Returns the value of field 'version'.
105    * 
106    * @return the value of field 'Version'.
107    */
108   public java.lang.String getVersion()
109   {
110     return this._version;
111   }
112
113   /**
114    * Method isValid.
115    * 
116    * @return true if this object is valid according to the schema
117    */
118   public boolean isValid()
119   {
120     try
121     {
122       validate();
123     } catch (org.exolab.castor.xml.ValidationException vex)
124     {
125       return false;
126     }
127     return true;
128   }
129
130   /**
131    * 
132    * 
133    * @param out
134    * @throws org.exolab.castor.xml.MarshalException
135    *           if object is null or if any SAXException is thrown during
136    *           marshaling
137    * @throws org.exolab.castor.xml.ValidationException
138    *           if this object is an invalid instance according to the schema
139    */
140   public void marshal(final java.io.Writer out)
141           throws org.exolab.castor.xml.MarshalException,
142           org.exolab.castor.xml.ValidationException
143   {
144     Marshaller.marshal(this, out);
145   }
146
147   /**
148    * 
149    * 
150    * @param handler
151    * @throws java.io.IOException
152    *           if an IOException occurs during marshaling
153    * @throws org.exolab.castor.xml.ValidationException
154    *           if this object is an invalid instance according to the schema
155    * @throws org.exolab.castor.xml.MarshalException
156    *           if object is null or if any SAXException is thrown during
157    *           marshaling
158    */
159   public void marshal(final org.xml.sax.ContentHandler handler)
160           throws java.io.IOException,
161           org.exolab.castor.xml.MarshalException,
162           org.exolab.castor.xml.ValidationException
163   {
164     Marshaller.marshal(this, handler);
165   }
166
167   /**
168    * Sets the value of field 'creationDate'.
169    * 
170    * @param creationDate
171    *          the value of field 'creationDate'.
172    */
173   public void setCreationDate(final java.util.Date creationDate)
174   {
175     this._creationDate = creationDate;
176   }
177
178   /**
179    * Sets the value of field 'jalviewModelSequence'.
180    * 
181    * @param jalviewModelSequence
182    *          the value of field 'jalviewModelSequence'.
183    */
184   public void setJalviewModelSequence(
185           final jalview.binding.JalviewModelSequence jalviewModelSequence)
186   {
187     this._jalviewModelSequence = jalviewModelSequence;
188   }
189
190   /**
191    * Sets the value of field 'vamsasModel'.
192    * 
193    * @param vamsasModel
194    *          the value of field 'vamsasModel'.
195    */
196   public void setVamsasModel(final jalview.binding.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.binding.JalviewModel
222    */
223   public static jalview.binding.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.binding.JalviewModel) Unmarshaller.unmarshal(
229             jalview.binding.JalviewModel.class, reader);
230   }
231
232   /**
233    * 
234    * 
235    * @throws org.exolab.castor.xml.ValidationException
236    *           if this object is an invalid instance according to the schema
237    */
238   public void validate() throws org.exolab.castor.xml.ValidationException
239   {
240     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
241     validator.validate(this);
242   }
243
244 }