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