c6be16846a4c8748fa16b4bd55ec653bb24b430e
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / AlcodonDescriptor.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.Alcodon;
15
16 /**
17  * Class AlcodonDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class AlcodonDescriptor 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 AlcodonDescriptor() {
54         super();
55         _nsURI = "www.vamsas.ac.uk/jalview/version2";
56         _xmlName = "alcodon";
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         //-- _pos1
64         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos1", "pos1", org.exolab.castor.xml.NodeType.Attribute);
65         handler = new org.exolab.castor.xml.XMLFieldHandler() {
66             public java.lang.Object getValue( java.lang.Object object ) 
67                 throws IllegalStateException
68             {
69                 Alcodon target = (Alcodon) object;
70                 if (!target.hasPos1()) { return null; }
71                 return new java.lang.Long(target.getPos1());
72             }
73             public void setValue( java.lang.Object object, java.lang.Object value) 
74                 throws IllegalStateException, IllegalArgumentException
75             {
76                 try {
77                     Alcodon target = (Alcodon) object;
78                     // if null, use delete method for optional primitives 
79                     if (value == null) {
80                         target.deletePos1();
81                         return;
82                     }
83                     target.setPos1( ((java.lang.Long) value).longValue());
84                 } catch (java.lang.Exception ex) {
85                     throw new IllegalStateException(ex.toString());
86                 }
87             }
88             public java.lang.Object newInstance(java.lang.Object parent) {
89                 return null;
90             }
91         };
92         desc.setHandler(handler);
93         desc.setMultivalued(false);
94         addFieldDescriptor(desc);
95         
96         //-- validation code for: _pos1
97         fieldValidator = new org.exolab.castor.xml.FieldValidator();
98         { //-- local scope
99             org.exolab.castor.xml.validators.LongValidator typeValidator;
100             typeValidator = new org.exolab.castor.xml.validators.LongValidator();
101             fieldValidator.setValidator(typeValidator);
102         }
103         desc.setValidator(fieldValidator);
104         //-- _pos2
105         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos2", "pos2", org.exolab.castor.xml.NodeType.Attribute);
106         handler = new org.exolab.castor.xml.XMLFieldHandler() {
107             public java.lang.Object getValue( java.lang.Object object ) 
108                 throws IllegalStateException
109             {
110                 Alcodon target = (Alcodon) object;
111                 if (!target.hasPos2()) { return null; }
112                 return new java.lang.Long(target.getPos2());
113             }
114             public void setValue( java.lang.Object object, java.lang.Object value) 
115                 throws IllegalStateException, IllegalArgumentException
116             {
117                 try {
118                     Alcodon target = (Alcodon) object;
119                     // if null, use delete method for optional primitives 
120                     if (value == null) {
121                         target.deletePos2();
122                         return;
123                     }
124                     target.setPos2( ((java.lang.Long) value).longValue());
125                 } catch (java.lang.Exception ex) {
126                     throw new IllegalStateException(ex.toString());
127                 }
128             }
129             public java.lang.Object newInstance(java.lang.Object parent) {
130                 return null;
131             }
132         };
133         desc.setHandler(handler);
134         desc.setMultivalued(false);
135         addFieldDescriptor(desc);
136         
137         //-- validation code for: _pos2
138         fieldValidator = new org.exolab.castor.xml.FieldValidator();
139         { //-- local scope
140             org.exolab.castor.xml.validators.LongValidator typeValidator;
141             typeValidator = new org.exolab.castor.xml.validators.LongValidator();
142             fieldValidator.setValidator(typeValidator);
143         }
144         desc.setValidator(fieldValidator);
145         //-- _pos3
146         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Long.TYPE, "_pos3", "pos3", org.exolab.castor.xml.NodeType.Attribute);
147         handler = new org.exolab.castor.xml.XMLFieldHandler() {
148             public java.lang.Object getValue( java.lang.Object object ) 
149                 throws IllegalStateException
150             {
151                 Alcodon target = (Alcodon) object;
152                 if (!target.hasPos3()) { return null; }
153                 return new java.lang.Long(target.getPos3());
154             }
155             public void setValue( java.lang.Object object, java.lang.Object value) 
156                 throws IllegalStateException, IllegalArgumentException
157             {
158                 try {
159                     Alcodon target = (Alcodon) object;
160                     // if null, use delete method for optional primitives 
161                     if (value == null) {
162                         target.deletePos3();
163                         return;
164                     }
165                     target.setPos3( ((java.lang.Long) value).longValue());
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 null;
172             }
173         };
174         desc.setHandler(handler);
175         desc.setMultivalued(false);
176         addFieldDescriptor(desc);
177         
178         //-- validation code for: _pos3
179         fieldValidator = new org.exolab.castor.xml.FieldValidator();
180         { //-- local scope
181             org.exolab.castor.xml.validators.LongValidator typeValidator;
182             typeValidator = new org.exolab.castor.xml.validators.LongValidator();
183             fieldValidator.setValidator(typeValidator);
184         }
185         desc.setValidator(fieldValidator);
186         //-- initialize element descriptors
187         
188     }
189
190
191       //-----------/
192      //- Methods -/
193     //-----------/
194
195     /**
196      * Method getAccessMode.
197      * 
198      * @return the access mode specified for this class.
199      */
200     public org.exolab.castor.mapping.AccessMode getAccessMode(
201     ) {
202         return null;
203     }
204
205     /**
206      * Method getIdentity.
207      * 
208      * @return the identity field, null if this class has no
209      * identity.
210      */
211     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
212     ) {
213         return super.getIdentity();
214     }
215
216     /**
217      * Method getJavaClass.
218      * 
219      * @return the Java class represented by this descriptor.
220      */
221     public java.lang.Class getJavaClass(
222     ) {
223         return jalview.schemabinding.version2.Alcodon.class;
224     }
225
226     /**
227      * Method getNameSpacePrefix.
228      * 
229      * @return the namespace prefix to use when marshaling as XML.
230      */
231     public java.lang.String getNameSpacePrefix(
232     ) {
233         return _nsPrefix;
234     }
235
236     /**
237      * Method getNameSpaceURI.
238      * 
239      * @return the namespace URI used when marshaling and
240      * unmarshaling as XML.
241      */
242     public java.lang.String getNameSpaceURI(
243     ) {
244         return _nsURI;
245     }
246
247     /**
248      * Method getValidator.
249      * 
250      * @return a specific validator for the class described by this
251      * ClassDescriptor.
252      */
253     public org.exolab.castor.xml.TypeValidator getValidator(
254     ) {
255         return this;
256     }
257
258     /**
259      * Method getXMLName.
260      * 
261      * @return the XML Name for the Class being described.
262      */
263     public java.lang.String getXMLName(
264     ) {
265         return _xmlName;
266     }
267
268     /**
269      * Method isElementDefinition.
270      * 
271      * @return true if XML schema definition of this Class is that
272      * of a global
273      * element or element with anonymous type definition.
274      */
275     public boolean isElementDefinition(
276     ) {
277         return _elementDefinition;
278     }
279
280 }