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