Jalview 2.6 source licence
[jalview.git] / src / jalview / schemabinding / version2 / VamsasModel.java
1 /*\r
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)\r
3  * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle\r
4  * \r
5  * This file is part of Jalview.\r
6  * \r
7  * Jalview is free software: you can redistribute it and/or\r
8  * modify it under the terms of the GNU General Public License \r
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\r
10  * \r
11  * Jalview is distributed in the hope that it will be useful, but \r
12  * WITHOUT ANY WARRANTY; without even the implied warranty \r
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR \r
14  * PURPOSE.  See the GNU General Public License for more details.\r
15  * \r
16  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.\r
17  */\r
18 package jalview.schemabinding.version2;\r
19 \r
20 //---------------------------------/\r
21 //- Imported classes and packages -/\r
22 //---------------------------------/\r
23 \r
24 import org.exolab.castor.xml.Marshaller;\r
25 import org.exolab.castor.xml.Unmarshaller;\r
26 \r
27 /**\r
28  * Class VamsasModel.\r
29  * \r
30  * @version $Revision$ $Date$\r
31  */\r
32 public class VamsasModel extends VAMSAS implements java.io.Serializable\r
33 {\r
34 \r
35   // ----------------/\r
36   // - Constructors -/\r
37   // ----------------/\r
38 \r
39   public VamsasModel()\r
40   {\r
41     super();\r
42   }\r
43 \r
44   // -----------/\r
45   // - Methods -/\r
46   // -----------/\r
47 \r
48   /**\r
49    * Method isValid.\r
50    * \r
51    * @return true if this object is valid according to the schema\r
52    */\r
53   public boolean isValid()\r
54   {\r
55     try\r
56     {\r
57       validate();\r
58     } catch (org.exolab.castor.xml.ValidationException vex)\r
59     {\r
60       return false;\r
61     }\r
62     return true;\r
63   }\r
64 \r
65   /**\r
66    * \r
67    * \r
68    * @param out\r
69    * @throws org.exolab.castor.xml.MarshalException\r
70    *           if object is null or if any SAXException is thrown during\r
71    *           marshaling\r
72    * @throws org.exolab.castor.xml.ValidationException\r
73    *           if this object is an invalid instance according to the schema\r
74    */\r
75   public void marshal(final java.io.Writer out)\r
76           throws org.exolab.castor.xml.MarshalException,\r
77           org.exolab.castor.xml.ValidationException\r
78   {\r
79     Marshaller.marshal(this, out);\r
80   }\r
81 \r
82   /**\r
83    * \r
84    * \r
85    * @param handler\r
86    * @throws java.io.IOException\r
87    *           if an IOException occurs during marshaling\r
88    * @throws org.exolab.castor.xml.ValidationException\r
89    *           if this object is an invalid instance according to the schema\r
90    * @throws org.exolab.castor.xml.MarshalException\r
91    *           if object is null or if any SAXException is thrown during\r
92    *           marshaling\r
93    */\r
94   public void marshal(final org.xml.sax.ContentHandler handler)\r
95           throws java.io.IOException,\r
96           org.exolab.castor.xml.MarshalException,\r
97           org.exolab.castor.xml.ValidationException\r
98   {\r
99     Marshaller.marshal(this, handler);\r
100   }\r
101 \r
102   /**\r
103    * Method unmarshal.\r
104    * \r
105    * @param reader\r
106    * @throws org.exolab.castor.xml.MarshalException\r
107    *           if object is null or if any SAXException is thrown during\r
108    *           marshaling\r
109    * @throws org.exolab.castor.xml.ValidationException\r
110    *           if this object is an invalid instance according to the schema\r
111    * @return the unmarshaled jalview.schemabinding.version2.VAMSAS\r
112    */\r
113   public static jalview.schemabinding.version2.VAMSAS unmarshal(\r
114           final java.io.Reader reader)\r
115           throws org.exolab.castor.xml.MarshalException,\r
116           org.exolab.castor.xml.ValidationException\r
117   {\r
118     return (jalview.schemabinding.version2.VAMSAS) Unmarshaller.unmarshal(\r
119             jalview.schemabinding.version2.VamsasModel.class, reader);\r
120   }\r
121 \r
122   /**\r
123    * \r
124    * \r
125    * @throws org.exolab.castor.xml.ValidationException\r
126    *           if this object is an invalid instance according to the schema\r
127    */\r
128   public void validate() throws org.exolab.castor.xml.ValidationException\r
129   {\r
130     org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();\r
131     validator.validate(this);\r
132   }\r
133 \r
134 }\r