b7087d2e6b6c59440c0b7e4d4c885aff2b414c08
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / PropertyDescriptor.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.Property;
15
16 /**
17  * Class PropertyDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class PropertyDescriptor 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 PropertyDescriptor() {
54         super();
55         _nsURI = "www.jalview.org";
56         _xmlName = "property";
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                 Property target = (Property) 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                     Property target = (Property) 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         //-- _value
103         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", org.exolab.castor.xml.NodeType.Attribute);
104         desc.setImmutable(true);
105         handler = new org.exolab.castor.xml.XMLFieldHandler() {
106             public java.lang.Object getValue( java.lang.Object object ) 
107                 throws IllegalStateException
108             {
109                 Property target = (Property) object;
110                 return target.getValue();
111             }
112             public void setValue( java.lang.Object object, java.lang.Object value) 
113                 throws IllegalStateException, IllegalArgumentException
114             {
115                 try {
116                     Property target = (Property) object;
117                     target.setValue( (java.lang.String) value);
118                 } catch (java.lang.Exception ex) {
119                     throw new IllegalStateException(ex.toString());
120                 }
121             }
122             public java.lang.Object newInstance(java.lang.Object parent) {
123                 return null;
124             }
125         };
126         desc.setHandler(handler);
127         desc.setRequired(true);
128         desc.setMultivalued(false);
129         addFieldDescriptor(desc);
130         
131         //-- validation code for: _value
132         fieldValidator = new org.exolab.castor.xml.FieldValidator();
133         fieldValidator.setMinOccurs(1);
134         { //-- local scope
135             org.exolab.castor.xml.validators.StringValidator typeValidator;
136             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
137             fieldValidator.setValidator(typeValidator);
138             typeValidator.setWhiteSpace("preserve");
139         }
140         desc.setValidator(fieldValidator);
141         //-- initialize element descriptors
142         
143     }
144
145
146       //-----------/
147      //- Methods -/
148     //-----------/
149
150     /**
151      * Method getAccessMode.
152      * 
153      * @return the access mode specified for this class.
154      */
155     public org.exolab.castor.mapping.AccessMode getAccessMode(
156     ) {
157         return null;
158     }
159
160     /**
161      * Method getIdentity.
162      * 
163      * @return the identity field, null if this class has no
164      * identity.
165      */
166     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
167     ) {
168         return super.getIdentity();
169     }
170
171     /**
172      * Method getJavaClass.
173      * 
174      * @return the Java class represented by this descriptor.
175      */
176     public java.lang.Class getJavaClass(
177     ) {
178         return jalview.schemabinding.version2.Property.class;
179     }
180
181     /**
182      * Method getNameSpacePrefix.
183      * 
184      * @return the namespace prefix to use when marshaling as XML.
185      */
186     public java.lang.String getNameSpacePrefix(
187     ) {
188         return _nsPrefix;
189     }
190
191     /**
192      * Method getNameSpaceURI.
193      * 
194      * @return the namespace URI used when marshaling and
195      * unmarshaling as XML.
196      */
197     public java.lang.String getNameSpaceURI(
198     ) {
199         return _nsURI;
200     }
201
202     /**
203      * Method getValidator.
204      * 
205      * @return a specific validator for the class described by this
206      * ClassDescriptor.
207      */
208     public org.exolab.castor.xml.TypeValidator getValidator(
209     ) {
210         return this;
211     }
212
213     /**
214      * Method getXMLName.
215      * 
216      * @return the XML Name for the Class being described.
217      */
218     public java.lang.String getXMLName(
219     ) {
220         return _xmlName;
221     }
222
223     /**
224      * Method isElementDefinition.
225      * 
226      * @return true if XML schema definition of this Class is that
227      * of a global
228      * element or element with anonymous type definition.
229      */
230     public boolean isElementDefinition(
231     ) {
232         return _elementDefinition;
233     }
234
235 }