JAL-1432 updated copyright notices
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / VAMSASDescriptor.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.VAMSAS;
26
27 /**
28  * Class VAMSASDescriptor.
29  * 
30  * @version $Revision$ $Date$
31  */
32 public class VAMSASDescriptor 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 VAMSASDescriptor()
65   {
66     super();
67     _nsURI = "www.vamsas.ac.uk/jalview/version2";
68     _xmlName = "VAMSAS";
69     _elementDefinition = false;
70
71     // -- set grouping compositor
72     setCompositorAsSequence();
73     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
74     org.exolab.castor.mapping.FieldHandler handler = null;
75     org.exolab.castor.xml.FieldValidator fieldValidator = null;
76     // -- initialize attribute descriptors
77
78     // -- initialize element descriptors
79
80     // -- _treeList
81     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
82             java.lang.String.class, "_treeList", "Tree",
83             org.exolab.castor.xml.NodeType.Element);
84     desc.setImmutable(true);
85     handler = new org.exolab.castor.xml.XMLFieldHandler()
86     {
87       public java.lang.Object getValue(java.lang.Object object)
88               throws IllegalStateException
89       {
90         VAMSAS target = (VAMSAS) object;
91         return target.getTree();
92       }
93
94       public void setValue(java.lang.Object object, java.lang.Object value)
95               throws IllegalStateException, IllegalArgumentException
96       {
97         try
98         {
99           VAMSAS target = (VAMSAS) object;
100           target.addTree((java.lang.String) value);
101         } catch (java.lang.Exception ex)
102         {
103           throw new IllegalStateException(ex.toString());
104         }
105       }
106
107       public void resetValue(Object object) throws IllegalStateException,
108               IllegalArgumentException
109       {
110         try
111         {
112           VAMSAS target = (VAMSAS) object;
113           target.removeAllTree();
114         } catch (java.lang.Exception ex)
115         {
116           throw new IllegalStateException(ex.toString());
117         }
118       }
119
120       public java.lang.Object newInstance(java.lang.Object parent)
121       {
122         return null;
123       }
124     };
125     desc.setHandler(handler);
126     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
127     desc.setMultivalued(true);
128     addFieldDescriptor(desc);
129
130     // -- validation code for: _treeList
131     fieldValidator = new org.exolab.castor.xml.FieldValidator();
132     fieldValidator.setMinOccurs(0);
133     { // -- local scope
134       org.exolab.castor.xml.validators.StringValidator typeValidator;
135       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
136       fieldValidator.setValidator(typeValidator);
137       typeValidator.setWhiteSpace("preserve");
138     }
139     desc.setValidator(fieldValidator);
140     // -- _sequenceSetList
141     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
142             jalview.schemabinding.version2.SequenceSet.class,
143             "_sequenceSetList", "SequenceSet",
144             org.exolab.castor.xml.NodeType.Element);
145     handler = new org.exolab.castor.xml.XMLFieldHandler()
146     {
147       public java.lang.Object getValue(java.lang.Object object)
148               throws IllegalStateException
149       {
150         VAMSAS target = (VAMSAS) object;
151         return target.getSequenceSet();
152       }
153
154       public void setValue(java.lang.Object object, java.lang.Object value)
155               throws IllegalStateException, IllegalArgumentException
156       {
157         try
158         {
159           VAMSAS target = (VAMSAS) object;
160           target.addSequenceSet((jalview.schemabinding.version2.SequenceSet) value);
161         } catch (java.lang.Exception ex)
162         {
163           throw new IllegalStateException(ex.toString());
164         }
165       }
166
167       public void resetValue(Object object) throws IllegalStateException,
168               IllegalArgumentException
169       {
170         try
171         {
172           VAMSAS target = (VAMSAS) object;
173           target.removeAllSequenceSet();
174         } catch (java.lang.Exception ex)
175         {
176           throw new IllegalStateException(ex.toString());
177         }
178       }
179
180       public java.lang.Object newInstance(java.lang.Object parent)
181       {
182         return new jalview.schemabinding.version2.SequenceSet();
183       }
184     };
185     desc.setHandler(handler);
186     desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
187     desc.setMultivalued(true);
188     addFieldDescriptor(desc);
189
190     // -- validation code for: _sequenceSetList
191     fieldValidator = new org.exolab.castor.xml.FieldValidator();
192     fieldValidator.setMinOccurs(0);
193     { // -- local scope
194     }
195     desc.setValidator(fieldValidator);
196   }
197
198   // -----------/
199   // - Methods -/
200   // -----------/
201
202   /**
203    * Method getAccessMode.
204    * 
205    * @return the access mode specified for this class.
206    */
207   public org.exolab.castor.mapping.AccessMode getAccessMode()
208   {
209     return null;
210   }
211
212   /**
213    * Method getIdentity.
214    * 
215    * @return the identity field, null if this class has no identity.
216    */
217   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
218   {
219     return super.getIdentity();
220   }
221
222   /**
223    * Method getJavaClass.
224    * 
225    * @return the Java class represented by this descriptor.
226    */
227   public java.lang.Class getJavaClass()
228   {
229     return jalview.schemabinding.version2.VAMSAS.class;
230   }
231
232   /**
233    * Method getNameSpacePrefix.
234    * 
235    * @return the namespace prefix to use when marshaling as XML.
236    */
237   public java.lang.String getNameSpacePrefix()
238   {
239     return _nsPrefix;
240   }
241
242   /**
243    * Method getNameSpaceURI.
244    * 
245    * @return the namespace URI used when marshaling and unmarshaling as XML.
246    */
247   public java.lang.String getNameSpaceURI()
248   {
249     return _nsURI;
250   }
251
252   /**
253    * Method getValidator.
254    * 
255    * @return a specific validator for the class described by this
256    *         ClassDescriptor.
257    */
258   public org.exolab.castor.xml.TypeValidator getValidator()
259   {
260     return this;
261   }
262
263   /**
264    * Method getXMLName.
265    * 
266    * @return the XML Name for the Class being described.
267    */
268   public java.lang.String getXMLName()
269   {
270     return _xmlName;
271   }
272
273   /**
274    * Method isElementDefinition.
275    * 
276    * @return true if XML schema definition of this Class is that of a global
277    *         element or element with anonymous type definition.
278    */
279   public boolean isElementDefinition()
280   {
281     return _elementDefinition;
282   }
283
284 }