update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / JalviewUserColoursDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.schemabinding.version2.descriptors;
26
27   //---------------------------------/
28  //- Imported classes and packages -/
29 //---------------------------------/
30
31 import jalview.schemabinding.version2.Colour;
32 import jalview.schemabinding.version2.JalviewUserColours;
33
34 /**
35  * Class JalviewUserColoursDescriptor.
36  * 
37  * @version $Revision$ $Date$
38  */
39 public class JalviewUserColoursDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
40
41
42       //--------------------------/
43      //- Class/Member Variables -/
44     //--------------------------/
45
46     /**
47      * Field _elementDefinition.
48      */
49     private boolean _elementDefinition;
50
51     /**
52      * Field _nsPrefix.
53      */
54     private java.lang.String _nsPrefix;
55
56     /**
57      * Field _nsURI.
58      */
59     private java.lang.String _nsURI;
60
61     /**
62      * Field _xmlName.
63      */
64     private java.lang.String _xmlName;
65
66
67       //----------------/
68      //- Constructors -/
69     //----------------/
70
71     public JalviewUserColoursDescriptor() {
72         super();
73         _nsURI = "www.jalview.org/colours";
74         _xmlName = "JalviewUserColours";
75         _elementDefinition = false;
76         
77         //-- set grouping compositor
78         setCompositorAsSequence();
79         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
80         org.exolab.castor.mapping.FieldHandler             handler        = null;
81         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
82         //-- initialize attribute descriptors
83         
84         //-- _schemeName
85         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_schemeName", "schemeName", org.exolab.castor.xml.NodeType.Attribute);
86         desc.setImmutable(true);
87         handler = new org.exolab.castor.xml.XMLFieldHandler() {
88             public java.lang.Object getValue( java.lang.Object object ) 
89                 throws IllegalStateException
90             {
91                 JalviewUserColours target = (JalviewUserColours) object;
92                 return target.getSchemeName();
93             }
94             public void setValue( java.lang.Object object, java.lang.Object value) 
95                 throws IllegalStateException, IllegalArgumentException
96             {
97                 try {
98                     JalviewUserColours target = (JalviewUserColours) object;
99                     target.setSchemeName( (java.lang.String) value);
100                 } catch (java.lang.Exception ex) {
101                     throw new IllegalStateException(ex.toString());
102                 }
103             }
104             public java.lang.Object newInstance(java.lang.Object parent) {
105                 return null;
106             }
107         };
108         desc.setHandler(handler);
109         desc.setMultivalued(false);
110         addFieldDescriptor(desc);
111         
112         //-- validation code for: _schemeName
113         fieldValidator = new org.exolab.castor.xml.FieldValidator();
114         { //-- local scope
115             org.exolab.castor.xml.validators.StringValidator typeValidator;
116             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
117             fieldValidator.setValidator(typeValidator);
118             typeValidator.setWhiteSpace("preserve");
119         }
120         desc.setValidator(fieldValidator);
121         //-- initialize element descriptors
122         
123         //-- _version
124         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "Version", org.exolab.castor.xml.NodeType.Element);
125         desc.setImmutable(true);
126         handler = new org.exolab.castor.xml.XMLFieldHandler() {
127             public java.lang.Object getValue( java.lang.Object object ) 
128                 throws IllegalStateException
129             {
130                 JalviewUserColours target = (JalviewUserColours) object;
131                 return target.getVersion();
132             }
133             public void setValue( java.lang.Object object, java.lang.Object value) 
134                 throws IllegalStateException, IllegalArgumentException
135             {
136                 try {
137                     JalviewUserColours target = (JalviewUserColours) object;
138                     target.setVersion( (java.lang.String) value);
139                 } catch (java.lang.Exception ex) {
140                     throw new IllegalStateException(ex.toString());
141                 }
142             }
143             public java.lang.Object newInstance(java.lang.Object parent) {
144                 return null;
145             }
146         };
147         desc.setHandler(handler);
148         desc.setMultivalued(false);
149         addFieldDescriptor(desc);
150         
151         //-- validation code for: _version
152         fieldValidator = new org.exolab.castor.xml.FieldValidator();
153         { //-- local scope
154             org.exolab.castor.xml.validators.StringValidator typeValidator;
155             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
156             fieldValidator.setValidator(typeValidator);
157             typeValidator.setWhiteSpace("preserve");
158         }
159         desc.setValidator(fieldValidator);
160         //-- _colourList
161         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(Colour.class, "_colourList", "colour", org.exolab.castor.xml.NodeType.Element);
162         handler = new org.exolab.castor.xml.XMLFieldHandler() {
163             public java.lang.Object getValue( java.lang.Object object ) 
164                 throws IllegalStateException
165             {
166                 JalviewUserColours target = (JalviewUserColours) object;
167                 return target.getColour();
168             }
169             public void setValue( java.lang.Object object, java.lang.Object value) 
170                 throws IllegalStateException, IllegalArgumentException
171             {
172                 try {
173                     JalviewUserColours target = (JalviewUserColours) object;
174                     target.addColour( (Colour) value);
175                 } catch (java.lang.Exception ex) {
176                     throw new IllegalStateException(ex.toString());
177                 }
178             }
179             public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
180                 try {
181                     JalviewUserColours target = (JalviewUserColours) object;
182                     target.removeAllColour();
183                 } catch (java.lang.Exception ex) {
184                     throw new IllegalStateException(ex.toString());
185                 }
186             }
187             public java.lang.Object newInstance(java.lang.Object parent) {
188                 return new Colour();
189             }
190         };
191         desc.setHandler(handler);
192         desc.setMultivalued(true);
193         addFieldDescriptor(desc);
194         
195         //-- validation code for: _colourList
196         fieldValidator = new org.exolab.castor.xml.FieldValidator();
197         fieldValidator.setMinOccurs(0);
198         { //-- local scope
199         }
200         desc.setValidator(fieldValidator);
201     }
202
203
204       //-----------/
205      //- Methods -/
206     //-----------/
207
208     /**
209      * Method getAccessMode.
210      * 
211      * @return the access mode specified for this class.
212      */
213     public org.exolab.castor.mapping.AccessMode getAccessMode(
214     ) {
215         return null;
216     }
217
218     /**
219      * Method getIdentity.
220      * 
221      * @return the identity field, null if this class has no
222      * identity.
223      */
224     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
225     ) {
226         return super.getIdentity();
227     }
228
229     /**
230      * Method getJavaClass.
231      * 
232      * @return the Java class represented by this descriptor.
233      */
234     public java.lang.Class getJavaClass(
235     ) {
236         return jalview.schemabinding.version2.JalviewUserColours.class;
237     }
238
239     /**
240      * Method getNameSpacePrefix.
241      * 
242      * @return the namespace prefix to use when marshaling as XML.
243      */
244     public java.lang.String getNameSpacePrefix(
245     ) {
246         return _nsPrefix;
247     }
248
249     /**
250      * Method getNameSpaceURI.
251      * 
252      * @return the namespace URI used when marshaling and
253      * unmarshaling as XML.
254      */
255     public java.lang.String getNameSpaceURI(
256     ) {
257         return _nsURI;
258     }
259
260     /**
261      * Method getValidator.
262      * 
263      * @return a specific validator for the class described by this
264      * ClassDescriptor.
265      */
266     public org.exolab.castor.xml.TypeValidator getValidator(
267     ) {
268         return this;
269     }
270
271     /**
272      * Method getXMLName.
273      * 
274      * @return the XML Name for the Class being described.
275      */
276     public java.lang.String getXMLName(
277     ) {
278         return _xmlName;
279     }
280
281     /**
282      * Method isElementDefinition.
283      * 
284      * @return true if XML schema definition of this Class is that
285      * of a global
286      * element or element with anonymous type definition.
287      */
288     public boolean isElementDefinition(
289     ) {
290         return _elementDefinition;
291     }
292
293 }