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