b48fc1e4e1a87bc56403ea01b873d869c24eaa31
[jalview.git] / src / jalview / binding / VamsasModel.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.binding;
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 VamsasModel.
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class VamsasModel extends VAMSAS implements java.io.Serializable
33 {
34
35   // ----------------/
36   // - Constructors -/
37   // ----------------/
38
39   public VamsasModel()
40   {
41     super();
42   }
43
44   // -----------/
45   // - Methods -/
46   // -----------/
47
48   /**
49    * Method isValid.
50    * 
51    * @return true if this object is valid according to the schema
52    */
53   public boolean isValid()
54   {
55     try
56     {
57       validate();
58     } catch (org.exolab.castor.xml.ValidationException vex)
59     {
60       return false;
61     }
62     return true;
63   }
64
65   /**
66    * 
67    * 
68    * @param out
69    * @throws org.exolab.castor.xml.MarshalException
70    *           if object is null or if any SAXException is thrown during
71    *           marshaling
72    * @throws org.exolab.castor.xml.ValidationException
73    *           if this object is an invalid instance according to the schema
74    */
75   public void marshal(final java.io.Writer out)
76           throws org.exolab.castor.xml.MarshalException,
77           org.exolab.castor.xml.ValidationException
78   {
79     Marshaller.marshal(this, out);
80   }
81
82   /**
83    * 
84    * 
85    * @param handler
86    * @throws java.io.IOException
87    *           if an IOException occurs during marshaling
88    * @throws org.exolab.castor.xml.ValidationException
89    *           if this object is an invalid instance according to the schema
90    * @throws org.exolab.castor.xml.MarshalException
91    *           if object is null or if any SAXException is thrown during
92    *           marshaling
93    */
94   public void marshal(final org.xml.sax.ContentHandler handler)
95           throws java.io.IOException,
96           org.exolab.castor.xml.MarshalException,
97           org.exolab.castor.xml.ValidationException
98   {
99     Marshaller.marshal(this, handler);
100   }
101
102   /**
103    * Method unmarshal.
104    * 
105    * @param reader
106    * @throws org.exolab.castor.xml.MarshalException
107    *           if object is null or if any SAXException is thrown during
108    *           marshaling
109    * @throws org.exolab.castor.xml.ValidationException
110    *           if this object is an invalid instance according to the schema
111    * @return the unmarshaled jalview.binding.VAMSAS
112    */
113   public static jalview.binding.VAMSAS unmarshal(final java.io.Reader reader)
114           throws org.exolab.castor.xml.MarshalException,
115           org.exolab.castor.xml.ValidationException
116   {
117     return (jalview.binding.VAMSAS) Unmarshaller.unmarshal(
118             jalview.binding.VamsasModel.class, reader);
119   }
120
121   /**
122    * 
123    * 
124    * @throws org.exolab.castor.xml.ValidationException
125    *           if this object is an invalid instance according to the schema
126    */
127   public void validate() throws org.exolab.castor.xml.ValidationException
128   {
129     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
130     validator.validate(this);
131   }
132
133 }