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