8c03e2e5d5ae21501627abb523769e744a0f302f
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / GroupDescriptor.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.Group;
15
16 /**
17  * Class GroupDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class GroupDescriptor 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 GroupDescriptor() {
54         super();
55         _nsURI = "www.jalview.org";
56         _xmlName = "group";
57         _elementDefinition = true;
58         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
59         org.exolab.castor.mapping.FieldHandler             handler        = null;
60         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
61         //-- initialize attribute descriptors
62         
63         //-- _name
64         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
65         desc.setImmutable(true);
66         handler = new org.exolab.castor.xml.XMLFieldHandler() {
67             public java.lang.Object getValue( java.lang.Object object ) 
68                 throws IllegalStateException
69             {
70                 Group target = (Group) object;
71                 return target.getName();
72             }
73             public void setValue( java.lang.Object object, java.lang.Object value) 
74                 throws IllegalStateException, IllegalArgumentException
75             {
76                 try {
77                     Group target = (Group) object;
78                     target.setName( (java.lang.String) value);
79                 } catch (java.lang.Exception ex) {
80                     throw new IllegalStateException(ex.toString());
81                 }
82             }
83             public java.lang.Object newInstance(java.lang.Object parent) {
84                 return null;
85             }
86         };
87         desc.setHandler(handler);
88         desc.setRequired(true);
89         desc.setMultivalued(false);
90         addFieldDescriptor(desc);
91         
92         //-- validation code for: _name
93         fieldValidator = new org.exolab.castor.xml.FieldValidator();
94         fieldValidator.setMinOccurs(1);
95         { //-- local scope
96             org.exolab.castor.xml.validators.StringValidator typeValidator;
97             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
98             fieldValidator.setValidator(typeValidator);
99             typeValidator.setWhiteSpace("preserve");
100         }
101         desc.setValidator(fieldValidator);
102         //-- _display
103         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_display", "display", org.exolab.castor.xml.NodeType.Attribute);
104         handler = new org.exolab.castor.xml.XMLFieldHandler() {
105             public java.lang.Object getValue( java.lang.Object object ) 
106                 throws IllegalStateException
107             {
108                 Group target = (Group) object;
109                 if (!target.hasDisplay()) { return null; }
110                 return (target.getDisplay() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
111             }
112             public void setValue( java.lang.Object object, java.lang.Object value) 
113                 throws IllegalStateException, IllegalArgumentException
114             {
115                 try {
116                     Group target = (Group) object;
117                     // ignore null values for non optional primitives
118                     if (value == null) { return; }
119                     
120                     target.setDisplay( ((java.lang.Boolean) value).booleanValue());
121                 } catch (java.lang.Exception ex) {
122                     throw new IllegalStateException(ex.toString());
123                 }
124             }
125             public java.lang.Object newInstance(java.lang.Object parent) {
126                 return null;
127             }
128         };
129         desc.setHandler(handler);
130         desc.setRequired(true);
131         desc.setMultivalued(false);
132         addFieldDescriptor(desc);
133         
134         //-- validation code for: _display
135         fieldValidator = new org.exolab.castor.xml.FieldValidator();
136         fieldValidator.setMinOccurs(1);
137         { //-- local scope
138             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
139             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
140             fieldValidator.setValidator(typeValidator);
141         }
142         desc.setValidator(fieldValidator);
143         //-- initialize element descriptors
144         
145     }
146
147
148       //-----------/
149      //- Methods -/
150     //-----------/
151
152     /**
153      * Method getAccessMode.
154      * 
155      * @return the access mode specified for this class.
156      */
157     public org.exolab.castor.mapping.AccessMode getAccessMode(
158     ) {
159         return null;
160     }
161
162     /**
163      * Method getIdentity.
164      * 
165      * @return the identity field, null if this class has no
166      * identity.
167      */
168     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
169     ) {
170         return super.getIdentity();
171     }
172
173     /**
174      * Method getJavaClass.
175      * 
176      * @return the Java class represented by this descriptor.
177      */
178     public java.lang.Class getJavaClass(
179     ) {
180         return jalview.schemabinding.version2.Group.class;
181     }
182
183     /**
184      * Method getNameSpacePrefix.
185      * 
186      * @return the namespace prefix to use when marshaling as XML.
187      */
188     public java.lang.String getNameSpacePrefix(
189     ) {
190         return _nsPrefix;
191     }
192
193     /**
194      * Method getNameSpaceURI.
195      * 
196      * @return the namespace URI used when marshaling and
197      * unmarshaling as XML.
198      */
199     public java.lang.String getNameSpaceURI(
200     ) {
201         return _nsURI;
202     }
203
204     /**
205      * Method getValidator.
206      * 
207      * @return a specific validator for the class described by this
208      * ClassDescriptor.
209      */
210     public org.exolab.castor.xml.TypeValidator getValidator(
211     ) {
212         return this;
213     }
214
215     /**
216      * Method getXMLName.
217      * 
218      * @return the XML Name for the Class being described.
219      */
220     public java.lang.String getXMLName(
221     ) {
222         return _xmlName;
223     }
224
225     /**
226      * Method isElementDefinition.
227      * 
228      * @return true if XML schema definition of this Class is that
229      * of a global
230      * element or element with anonymous type definition.
231      */
232     public boolean isElementDefinition(
233     ) {
234         return _elementDefinition;
235     }
236
237 }