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