530a69d546ec0aed50068e8c1f800310238dc2e5
[jalview.git] / src / jalview / binding / JalviewModel.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
3  * Copyright (C) 2009 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       //----------------/
62      //- Constructors -/
63     //----------------/
64
65     public JalviewModel() {
66         super();
67     }
68
69
70       //-----------/
71      //- Methods -/
72     //-----------/
73
74     /**
75      * Returns the value of field 'creationDate'.
76      * 
77      * @return the value of field 'CreationDate'.
78      */
79     public java.util.Date getCreationDate(
80     ) {
81         return this._creationDate;
82     }
83
84     /**
85      * Returns the value of field 'jalviewModelSequence'.
86      * 
87      * @return the value of field 'JalviewModelSequence'.
88      */
89     public jalview.binding.JalviewModelSequence getJalviewModelSequence(
90     ) {
91         return this._jalviewModelSequence;
92     }
93
94     /**
95      * Returns the value of field 'vamsasModel'.
96      * 
97      * @return the value of field 'VamsasModel'.
98      */
99     public jalview.binding.VamsasModel getVamsasModel(
100     ) {
101         return this._vamsasModel;
102     }
103
104     /**
105      * Returns the value of field 'version'.
106      * 
107      * @return the value of field 'Version'.
108      */
109     public java.lang.String getVersion(
110     ) {
111         return this._version;
112     }
113
114     /**
115      * Method isValid.
116      * 
117      * @return true if this object is valid according to the schema
118      */
119     public boolean isValid(
120     ) {
121         try {
122             validate();
123         } catch (org.exolab.castor.xml.ValidationException vex) {
124             return false;
125         }
126         return true;
127     }
128
129     /**
130      * 
131      * 
132      * @param out
133      * @throws org.exolab.castor.xml.MarshalException if object is
134      * null or if any SAXException is thrown during marshaling
135      * @throws org.exolab.castor.xml.ValidationException if this
136      * object is an invalid instance according to the schema
137      */
138     public void marshal(
139             final java.io.Writer out)
140     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
141         Marshaller.marshal(this, out);
142     }
143
144     /**
145      * 
146      * 
147      * @param handler
148      * @throws java.io.IOException if an IOException occurs during
149      * marshaling
150      * @throws org.exolab.castor.xml.ValidationException if this
151      * object is an invalid instance according to the schema
152      * @throws org.exolab.castor.xml.MarshalException if object is
153      * null or if any SAXException is thrown during marshaling
154      */
155     public void marshal(
156             final org.xml.sax.ContentHandler handler)
157     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
158         Marshaller.marshal(this, handler);
159     }
160
161     /**
162      * Sets the value of field 'creationDate'.
163      * 
164      * @param creationDate the value of field 'creationDate'.
165      */
166     public void setCreationDate(
167             final java.util.Date creationDate) {
168         this._creationDate = creationDate;
169     }
170
171     /**
172      * Sets the value of field 'jalviewModelSequence'.
173      * 
174      * @param jalviewModelSequence the value of field
175      * 'jalviewModelSequence'.
176      */
177     public void setJalviewModelSequence(
178             final jalview.binding.JalviewModelSequence jalviewModelSequence) {
179         this._jalviewModelSequence = jalviewModelSequence;
180     }
181
182     /**
183      * Sets the value of field 'vamsasModel'.
184      * 
185      * @param vamsasModel the value of field 'vamsasModel'.
186      */
187     public void setVamsasModel(
188             final jalview.binding.VamsasModel vamsasModel) {
189         this._vamsasModel = vamsasModel;
190     }
191
192     /**
193      * Sets the value of field 'version'.
194      * 
195      * @param version the value of field 'version'.
196      */
197     public void setVersion(
198             final java.lang.String version) {
199         this._version = version;
200     }
201
202     /**
203      * Method unmarshal.
204      * 
205      * @param reader
206      * @throws org.exolab.castor.xml.MarshalException if object is
207      * null or if any SAXException is thrown during marshaling
208      * @throws org.exolab.castor.xml.ValidationException if this
209      * object is an invalid instance according to the schema
210      * @return the unmarshaled jalview.binding.JalviewModel
211      */
212     public static jalview.binding.JalviewModel unmarshal(
213             final java.io.Reader reader)
214     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
215         return (jalview.binding.JalviewModel) Unmarshaller.unmarshal(jalview.binding.JalviewModel.class, reader);
216     }
217
218     /**
219      * 
220      * 
221      * @throws org.exolab.castor.xml.ValidationException if this
222      * object is an invalid instance according to the schema
223      */
224     public void validate(
225     )
226     throws org.exolab.castor.xml.ValidationException {
227         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
228         validator.validate(this);
229     }
230
231 }