e5e799b9b510b624267ec8bbbe3da0960f017243
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / UserColoursDescriptor.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.UserColours;
15
16 /**
17  * Class UserColoursDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class UserColoursDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
22
23
24       //--------------------------/
25      //- Class/Member Variables -/
26     //--------------------------/
27
28     /**
29      * Field _elementDefinition.
30      */
31     private boolean _elementDefinition;
32
33     /**
34      * Field _nsPrefix.
35      */
36     private java.lang.String _nsPrefix;
37
38     /**
39      * Field _nsURI.
40      */
41     private java.lang.String _nsURI;
42
43     /**
44      * Field _xmlName.
45      */
46     private java.lang.String _xmlName;
47
48
49       //----------------/
50      //- Constructors -/
51     //----------------/
52
53     public UserColoursDescriptor() {
54         super();
55         _nsURI = "www.jalview.org";
56         _xmlName = "UserColours";
57         _elementDefinition = true;
58         
59         //-- set grouping compositor
60         setCompositorAsSequence();
61         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
62         org.exolab.castor.mapping.FieldHandler             handler        = null;
63         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
64         //-- initialize attribute descriptors
65         
66         //-- _id
67         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
68         desc.setImmutable(true);
69         handler = new org.exolab.castor.xml.XMLFieldHandler() {
70             public java.lang.Object getValue( java.lang.Object object ) 
71                 throws IllegalStateException
72             {
73                 UserColours target = (UserColours) object;
74                 return target.getId();
75             }
76             public void setValue( java.lang.Object object, java.lang.Object value) 
77                 throws IllegalStateException, IllegalArgumentException
78             {
79                 try {
80                     UserColours target = (UserColours) object;
81                     target.setId( (java.lang.String) value);
82                 } catch (java.lang.Exception ex) {
83                     throw new IllegalStateException(ex.toString());
84                 }
85             }
86             public java.lang.Object newInstance(java.lang.Object parent) {
87                 return null;
88             }
89         };
90         desc.setHandler(handler);
91         desc.setMultivalued(false);
92         addFieldDescriptor(desc);
93         
94         //-- validation code for: _id
95         fieldValidator = new org.exolab.castor.xml.FieldValidator();
96         { //-- local scope
97             org.exolab.castor.xml.validators.StringValidator typeValidator;
98             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
99             fieldValidator.setValidator(typeValidator);
100             typeValidator.setWhiteSpace("preserve");
101         }
102         desc.setValidator(fieldValidator);
103         //-- initialize element descriptors
104         
105         //-- _userColourScheme
106         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.UserColourScheme.class, "_userColourScheme", "UserColourScheme", org.exolab.castor.xml.NodeType.Element);
107         handler = new org.exolab.castor.xml.XMLFieldHandler() {
108             public java.lang.Object getValue( java.lang.Object object ) 
109                 throws IllegalStateException
110             {
111                 UserColours target = (UserColours) object;
112                 return target.getUserColourScheme();
113             }
114             public void setValue( java.lang.Object object, java.lang.Object value) 
115                 throws IllegalStateException, IllegalArgumentException
116             {
117                 try {
118                     UserColours target = (UserColours) object;
119                     target.setUserColourScheme( (jalview.schemabinding.version2.UserColourScheme) value);
120                 } catch (java.lang.Exception ex) {
121                     throw new IllegalStateException(ex.toString());
122                 }
123             }
124             public java.lang.Object newInstance(java.lang.Object parent) {
125                 return new jalview.schemabinding.version2.UserColourScheme();
126             }
127         };
128         desc.setHandler(handler);
129         desc.setNameSpaceURI("www.jalview.org");
130         desc.setRequired(true);
131         desc.setMultivalued(false);
132         addFieldDescriptor(desc);
133         
134         //-- validation code for: _userColourScheme
135         fieldValidator = new org.exolab.castor.xml.FieldValidator();
136         fieldValidator.setMinOccurs(1);
137         { //-- local scope
138         }
139         desc.setValidator(fieldValidator);
140     }
141
142
143       //-----------/
144      //- Methods -/
145     //-----------/
146
147     /**
148      * Method getAccessMode.
149      * 
150      * @return the access mode specified for this class.
151      */
152     public org.exolab.castor.mapping.AccessMode getAccessMode(
153     ) {
154         return null;
155     }
156
157     /**
158      * Method getIdentity.
159      * 
160      * @return the identity field, null if this class has no
161      * identity.
162      */
163     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
164     ) {
165         return super.getIdentity();
166     }
167
168     /**
169      * Method getJavaClass.
170      * 
171      * @return the Java class represented by this descriptor.
172      */
173     public java.lang.Class getJavaClass(
174     ) {
175         return jalview.schemabinding.version2.UserColours.class;
176     }
177
178     /**
179      * Method getNameSpacePrefix.
180      * 
181      * @return the namespace prefix to use when marshaling as XML.
182      */
183     public java.lang.String getNameSpacePrefix(
184     ) {
185         return _nsPrefix;
186     }
187
188     /**
189      * Method getNameSpaceURI.
190      * 
191      * @return the namespace URI used when marshaling and
192      * unmarshaling as XML.
193      */
194     public java.lang.String getNameSpaceURI(
195     ) {
196         return _nsURI;
197     }
198
199     /**
200      * Method getValidator.
201      * 
202      * @return a specific validator for the class described by this
203      * ClassDescriptor.
204      */
205     public org.exolab.castor.xml.TypeValidator getValidator(
206     ) {
207         return this;
208     }
209
210     /**
211      * Method getXMLName.
212      * 
213      * @return the XML Name for the Class being described.
214      */
215     public java.lang.String getXMLName(
216     ) {
217         return _xmlName;
218     }
219
220     /**
221      * Method isElementDefinition.
222      * 
223      * @return true if XML schema definition of this Class is that
224      * of a global
225      * element or element with anonymous type definition.
226      */
227     public boolean isElementDefinition(
228     ) {
229         return _elementDefinition;
230     }
231
232 }