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