001c3e51c719ae22ac763f529d3a95be357d90b9
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / PdbentryDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3  * Copyright (C) 2014 The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
10  *  
11  * Jalview is distributed in the hope that it will be useful, but 
12  * WITHOUT ANY WARRANTY; without even the implied warranty 
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
14  * PURPOSE.  See the GNU General Public License for more details.
15  * 
16  * You should have received a copy of the GNU General Public License along with Jalview.  
17  * If not, see <http://www.gnu.org/licenses/>.
18  * The Jalview Authors are detailed in the 'AUTHORS' file.
19  ******************************************************************************/
20 /*
21  * This class was automatically generated with 
22  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
23  * Schema.
24  * $Id$
25  */
26
27 package jalview.schemabinding.version2.descriptors;
28
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
32
33 import jalview.schemabinding.version2.Pdbentry;
34
35 /**
36  * Class PdbentryDescriptor.
37  * 
38  * @version $Revision$ $Date$
39  */
40 public class PdbentryDescriptor extends
41         org.exolab.castor.xml.util.XMLClassDescriptorImpl
42 {
43
44   // --------------------------/
45   // - Class/Member Variables -/
46   // --------------------------/
47
48   /**
49    * Field _elementDefinition.
50    */
51   private boolean _elementDefinition;
52
53   /**
54    * Field _nsPrefix.
55    */
56   private java.lang.String _nsPrefix;
57
58   /**
59    * Field _nsURI.
60    */
61   private java.lang.String _nsURI;
62
63   /**
64    * Field _xmlName.
65    */
66   private java.lang.String _xmlName;
67
68   // ----------------/
69   // - Constructors -/
70   // ----------------/
71
72   public PdbentryDescriptor()
73   {
74     super();
75     _xmlName = "pdbentry";
76     _elementDefinition = false;
77     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
78     org.exolab.castor.mapping.FieldHandler handler = null;
79     org.exolab.castor.xml.FieldValidator fieldValidator = null;
80     // -- initialize attribute descriptors
81
82     // -- _id
83     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
84             java.lang.String.class, "_id", "id",
85             org.exolab.castor.xml.NodeType.Attribute);
86     desc.setImmutable(true);
87     handler = new org.exolab.castor.xml.XMLFieldHandler()
88     {
89       public java.lang.Object getValue(java.lang.Object object)
90               throws IllegalStateException
91       {
92         Pdbentry target = (Pdbentry) object;
93         return target.getId();
94       }
95
96       public void setValue(java.lang.Object object, java.lang.Object value)
97               throws IllegalStateException, IllegalArgumentException
98       {
99         try
100         {
101           Pdbentry target = (Pdbentry) object;
102           target.setId((java.lang.String) value);
103         } catch (java.lang.Exception ex)
104         {
105           throw new IllegalStateException(ex.toString());
106         }
107       }
108
109       public java.lang.Object newInstance(java.lang.Object parent)
110       {
111         return null;
112       }
113     };
114     desc.setHandler(handler);
115     desc.setRequired(true);
116     desc.setMultivalued(false);
117     addFieldDescriptor(desc);
118
119     // -- validation code for: _id
120     fieldValidator = new org.exolab.castor.xml.FieldValidator();
121     fieldValidator.setMinOccurs(1);
122     { // -- local scope
123       org.exolab.castor.xml.validators.StringValidator typeValidator;
124       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
125       fieldValidator.setValidator(typeValidator);
126       typeValidator.setWhiteSpace("preserve");
127     }
128     desc.setValidator(fieldValidator);
129     // -- _type
130     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
131             java.lang.String.class, "_type", "type",
132             org.exolab.castor.xml.NodeType.Attribute);
133     desc.setImmutable(true);
134     handler = new org.exolab.castor.xml.XMLFieldHandler()
135     {
136       public java.lang.Object getValue(java.lang.Object object)
137               throws IllegalStateException
138       {
139         Pdbentry target = (Pdbentry) object;
140         return target.getType();
141       }
142
143       public void setValue(java.lang.Object object, java.lang.Object value)
144               throws IllegalStateException, IllegalArgumentException
145       {
146         try
147         {
148           Pdbentry target = (Pdbentry) object;
149           target.setType((java.lang.String) value);
150         } catch (java.lang.Exception ex)
151         {
152           throw new IllegalStateException(ex.toString());
153         }
154       }
155
156       public java.lang.Object newInstance(java.lang.Object parent)
157       {
158         return null;
159       }
160     };
161     desc.setHandler(handler);
162     desc.setMultivalued(false);
163     addFieldDescriptor(desc);
164
165     // -- validation code for: _type
166     fieldValidator = new org.exolab.castor.xml.FieldValidator();
167     { // -- local scope
168       org.exolab.castor.xml.validators.StringValidator typeValidator;
169       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
170       fieldValidator.setValidator(typeValidator);
171       typeValidator.setWhiteSpace("preserve");
172     }
173     desc.setValidator(fieldValidator);
174     // -- _file
175     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
176             java.lang.String.class, "_file", "file",
177             org.exolab.castor.xml.NodeType.Attribute);
178     desc.setImmutable(true);
179     handler = new org.exolab.castor.xml.XMLFieldHandler()
180     {
181       public java.lang.Object getValue(java.lang.Object object)
182               throws IllegalStateException
183       {
184         Pdbentry target = (Pdbentry) object;
185         return target.getFile();
186       }
187
188       public void setValue(java.lang.Object object, java.lang.Object value)
189               throws IllegalStateException, IllegalArgumentException
190       {
191         try
192         {
193           Pdbentry target = (Pdbentry) object;
194           target.setFile((java.lang.String) value);
195         } catch (java.lang.Exception ex)
196         {
197           throw new IllegalStateException(ex.toString());
198         }
199       }
200
201       public java.lang.Object newInstance(java.lang.Object parent)
202       {
203         return null;
204       }
205     };
206     desc.setHandler(handler);
207     desc.setMultivalued(false);
208     addFieldDescriptor(desc);
209
210     // -- validation code for: _file
211     fieldValidator = new org.exolab.castor.xml.FieldValidator();
212     { // -- local scope
213       org.exolab.castor.xml.validators.StringValidator typeValidator;
214       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
215       fieldValidator.setValidator(typeValidator);
216       typeValidator.setWhiteSpace("preserve");
217     }
218     desc.setValidator(fieldValidator);
219     // -- initialize element descriptors
220
221     // -- _items
222     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
223             jalview.schemabinding.version2.PdbentryItem.class, "_items",
224             (java.lang.String) null, org.exolab.castor.xml.NodeType.Element);
225     handler = new org.exolab.castor.xml.XMLFieldHandler()
226     {
227       public java.lang.Object getValue(java.lang.Object object)
228               throws IllegalStateException
229       {
230         Pdbentry target = (Pdbentry) object;
231         return target.getPdbentryItem();
232       }
233
234       public void setValue(java.lang.Object object, java.lang.Object value)
235               throws IllegalStateException, IllegalArgumentException
236       {
237         try
238         {
239           Pdbentry target = (Pdbentry) object;
240           target.addPdbentryItem((jalview.schemabinding.version2.PdbentryItem) value);
241         } catch (java.lang.Exception ex)
242         {
243           throw new IllegalStateException(ex.toString());
244         }
245       }
246
247       public void resetValue(Object object) throws IllegalStateException,
248               IllegalArgumentException
249       {
250         try
251         {
252           Pdbentry target = (Pdbentry) object;
253           target.removeAllPdbentryItem();
254         } catch (java.lang.Exception ex)
255         {
256           throw new IllegalStateException(ex.toString());
257         }
258       }
259
260       public java.lang.Object newInstance(java.lang.Object parent)
261       {
262         return new jalview.schemabinding.version2.PdbentryItem();
263       }
264     };
265     desc.setHandler(handler);
266     desc.setContainer(true);
267     desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.PdbentryItemDescriptor());
268     desc.setMultivalued(true);
269     addFieldDescriptor(desc);
270
271     // -- validation code for: _items
272     fieldValidator = new org.exolab.castor.xml.FieldValidator();
273     fieldValidator.setMinOccurs(0);
274     { // -- local scope
275     }
276     desc.setValidator(fieldValidator);
277   }
278
279   // -----------/
280   // - Methods -/
281   // -----------/
282
283   /**
284    * Method getAccessMode.
285    * 
286    * @return the access mode specified for this class.
287    */
288   public org.exolab.castor.mapping.AccessMode getAccessMode()
289   {
290     return null;
291   }
292
293   /**
294    * Method getIdentity.
295    * 
296    * @return the identity field, null if this class has no identity.
297    */
298   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
299   {
300     return super.getIdentity();
301   }
302
303   /**
304    * Method getJavaClass.
305    * 
306    * @return the Java class represented by this descriptor.
307    */
308   public java.lang.Class getJavaClass()
309   {
310     return jalview.schemabinding.version2.Pdbentry.class;
311   }
312
313   /**
314    * Method getNameSpacePrefix.
315    * 
316    * @return the namespace prefix to use when marshaling as XML.
317    */
318   public java.lang.String getNameSpacePrefix()
319   {
320     return _nsPrefix;
321   }
322
323   /**
324    * Method getNameSpaceURI.
325    * 
326    * @return the namespace URI used when marshaling and unmarshaling as XML.
327    */
328   public java.lang.String getNameSpaceURI()
329   {
330     return _nsURI;
331   }
332
333   /**
334    * Method getValidator.
335    * 
336    * @return a specific validator for the class described by this
337    *         ClassDescriptor.
338    */
339   public org.exolab.castor.xml.TypeValidator getValidator()
340   {
341     return this;
342   }
343
344   /**
345    * Method getXMLName.
346    * 
347    * @return the XML Name for the Class being described.
348    */
349   public java.lang.String getXMLName()
350   {
351     return _xmlName;
352   }
353
354   /**
355    * Method isElementDefinition.
356    * 
357    * @return true if XML schema definition of this Class is that of a global
358    *         element or element with anonymous type definition.
359    */
360   public boolean isElementDefinition()
361   {
362     return _elementDefinition;
363   }
364
365 }