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