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