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