0b290534f3f3b4202cdb65c2a1d2b986c902a7ea
[jalview.git] / src / jalview / binding / UserColours.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 UserColours.
30  * 
31  * @version $Revision$ $Date$
32  */
33 public class UserColours implements java.io.Serializable {
34
35
36       //--------------------------/
37      //- Class/Member Variables -/
38     //--------------------------/
39
40     /**
41      * Field _id.
42      */
43     private java.lang.String _id;
44
45     /**
46      * Field _userColourScheme.
47      */
48     private jalview.binding.UserColourScheme _userColourScheme;
49
50
51       //----------------/
52      //- Constructors -/
53     //----------------/
54
55     public UserColours() {
56         super();
57     }
58
59
60       //-----------/
61      //- Methods -/
62     //-----------/
63
64     /**
65      * Returns the value of field 'id'.
66      * 
67      * @return the value of field 'Id'.
68      */
69     public java.lang.String getId(
70     ) {
71         return this._id;
72     }
73
74     /**
75      * Returns the value of field 'userColourScheme'.
76      * 
77      * @return the value of field 'UserColourScheme'.
78      */
79     public jalview.binding.UserColourScheme getUserColourScheme(
80     ) {
81         return this._userColourScheme;
82     }
83
84     /**
85      * Method isValid.
86      * 
87      * @return true if this object is valid according to the schema
88      */
89     public boolean isValid(
90     ) {
91         try {
92             validate();
93         } catch (org.exolab.castor.xml.ValidationException vex) {
94             return false;
95         }
96         return true;
97     }
98
99     /**
100      * 
101      * 
102      * @param out
103      * @throws org.exolab.castor.xml.MarshalException if object is
104      * null or if any SAXException is thrown during marshaling
105      * @throws org.exolab.castor.xml.ValidationException if this
106      * object is an invalid instance according to the schema
107      */
108     public void marshal(
109             final java.io.Writer out)
110     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
111         Marshaller.marshal(this, out);
112     }
113
114     /**
115      * 
116      * 
117      * @param handler
118      * @throws java.io.IOException if an IOException occurs during
119      * marshaling
120      * @throws org.exolab.castor.xml.ValidationException if this
121      * object is an invalid instance according to the schema
122      * @throws org.exolab.castor.xml.MarshalException if object is
123      * null or if any SAXException is thrown during marshaling
124      */
125     public void marshal(
126             final org.xml.sax.ContentHandler handler)
127     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
128         Marshaller.marshal(this, handler);
129     }
130
131     /**
132      * Sets the value of field 'id'.
133      * 
134      * @param id the value of field 'id'.
135      */
136     public void setId(
137             final java.lang.String id) {
138         this._id = id;
139     }
140
141     /**
142      * Sets the value of field 'userColourScheme'.
143      * 
144      * @param userColourScheme the value of field 'userColourScheme'
145      */
146     public void setUserColourScheme(
147             final jalview.binding.UserColourScheme userColourScheme) {
148         this._userColourScheme = userColourScheme;
149     }
150
151     /**
152      * Method unmarshal.
153      * 
154      * @param reader
155      * @throws org.exolab.castor.xml.MarshalException if object is
156      * null or if any SAXException is thrown during marshaling
157      * @throws org.exolab.castor.xml.ValidationException if this
158      * object is an invalid instance according to the schema
159      * @return the unmarshaled jalview.binding.UserColours
160      */
161     public static jalview.binding.UserColours unmarshal(
162             final java.io.Reader reader)
163     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
164         return (jalview.binding.UserColours) Unmarshaller.unmarshal(jalview.binding.UserColours.class, reader);
165     }
166
167     /**
168      * 
169      * 
170      * @throws org.exolab.castor.xml.ValidationException if this
171      * object is an invalid instance according to the schema
172      */
173     public void validate(
174     )
175     throws org.exolab.castor.xml.ValidationException {
176         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
177         validator.validate(this);
178     }
179
180 }