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