eae870d124b9a81a8953987942a5d907a1816e52
[jalview.git] / src / jalview / binding / JalviewModel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.4)
3  * Copyright (C) 2008 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4  * 
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  * 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  * 
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
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
139    *                 schema
140    */
141   public void marshal(final java.io.Writer out)
142           throws org.exolab.castor.xml.MarshalException,
143           org.exolab.castor.xml.ValidationException
144   {
145     Marshaller.marshal(this, out);
146   }
147
148   /**
149    * 
150    * 
151    * @param handler
152    * @throws java.io.IOException
153    *                 if an IOException occurs during marshaling
154    * @throws org.exolab.castor.xml.ValidationException
155    *                 if this object is an invalid instance according to the
156    *                 schema
157    * @throws org.exolab.castor.xml.MarshalException
158    *                 if object is null or if any SAXException is thrown during
159    *                 marshaling
160    */
161   public void marshal(final org.xml.sax.ContentHandler handler)
162           throws java.io.IOException,
163           org.exolab.castor.xml.MarshalException,
164           org.exolab.castor.xml.ValidationException
165   {
166     Marshaller.marshal(this, handler);
167   }
168
169   /**
170    * Sets the value of field 'creationDate'.
171    * 
172    * @param creationDate
173    *                the value of field 'creationDate'.
174    */
175   public void setCreationDate(final java.util.Date creationDate)
176   {
177     this._creationDate = creationDate;
178   }
179
180   /**
181    * Sets the value of field 'jalviewModelSequence'.
182    * 
183    * @param jalviewModelSequence
184    *                the value of field 'jalviewModelSequence'.
185    */
186   public void setJalviewModelSequence(
187           final jalview.binding.JalviewModelSequence jalviewModelSequence)
188   {
189     this._jalviewModelSequence = jalviewModelSequence;
190   }
191
192   /**
193    * Sets the value of field 'vamsasModel'.
194    * 
195    * @param vamsasModel
196    *                the value of field 'vamsasModel'.
197    */
198   public void setVamsasModel(final jalview.binding.VamsasModel vamsasModel)
199   {
200     this._vamsasModel = vamsasModel;
201   }
202
203   /**
204    * Sets the value of field 'version'.
205    * 
206    * @param version
207    *                the value of field 'version'.
208    */
209   public void setVersion(final java.lang.String version)
210   {
211     this._version = version;
212   }
213
214   /**
215    * Method unmarshal.
216    * 
217    * @param reader
218    * @throws org.exolab.castor.xml.MarshalException
219    *                 if object is null or if any SAXException is thrown during
220    *                 marshaling
221    * @throws org.exolab.castor.xml.ValidationException
222    *                 if this object is an invalid instance according to the
223    *                 schema
224    * @return the unmarshaled jalview.binding.JalviewModel
225    */
226   public static jalview.binding.JalviewModel unmarshal(
227           final java.io.Reader reader)
228           throws org.exolab.castor.xml.MarshalException,
229           org.exolab.castor.xml.ValidationException
230   {
231     return (jalview.binding.JalviewModel) Unmarshaller.unmarshal(
232             jalview.binding.JalviewModel.class, reader);
233   }
234
235   /**
236    * 
237    * 
238    * @throws org.exolab.castor.xml.ValidationException
239    *                 if this object is an invalid instance according to the
240    *                 schema
241    */
242   public void validate() throws org.exolab.castor.xml.ValidationException
243   {
244     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
245     validator.validate(this);
246   }
247
248 }