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