dcdc8e4e94406c21b7662913c575287fa64790d5
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / SequenceSetPropertiesDescriptor.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
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
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  */
21 package jalview.schemabinding.version2.descriptors;
22
23 //---------------------------------/
24 //- Imported classes and packages -/
25 //---------------------------------/
26
27 import jalview.schemabinding.version2.SequenceSetProperties;
28
29 /**
30  * Class SequenceSetPropertiesDescriptor.
31  * 
32  * @version $Revision$ $Date$
33  */
34 public class SequenceSetPropertiesDescriptor extends
35         org.exolab.castor.xml.util.XMLClassDescriptorImpl
36 {
37
38   // --------------------------/
39   // - Class/Member Variables -/
40   // --------------------------/
41
42   /**
43    * Field _elementDefinition.
44    */
45   private boolean _elementDefinition;
46
47   /**
48    * Field _nsPrefix.
49    */
50   private java.lang.String _nsPrefix;
51
52   /**
53    * Field _nsURI.
54    */
55   private java.lang.String _nsURI;
56
57   /**
58    * Field _xmlName.
59    */
60   private java.lang.String _xmlName;
61
62   // ----------------/
63   // - Constructors -/
64   // ----------------/
65
66   public SequenceSetPropertiesDescriptor()
67   {
68     super();
69     _nsURI = "www.vamsas.ac.uk/jalview/version2";
70     _xmlName = "sequenceSetProperties";
71     _elementDefinition = true;
72     org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
73     org.exolab.castor.mapping.FieldHandler handler = null;
74     org.exolab.castor.xml.FieldValidator fieldValidator = null;
75     // -- initialize attribute descriptors
76
77     // -- _key
78     desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
79             java.lang.String.class, "_key", "key",
80             org.exolab.castor.xml.NodeType.Attribute);
81     desc.setImmutable(true);
82     handler = new org.exolab.castor.xml.XMLFieldHandler()
83     {
84       public java.lang.Object getValue(java.lang.Object object)
85               throws IllegalStateException
86       {
87         SequenceSetProperties target = (SequenceSetProperties) object;
88         return target.getKey();
89       }
90
91       public void setValue(java.lang.Object object, java.lang.Object value)
92               throws IllegalStateException, IllegalArgumentException
93       {
94         try
95         {
96           SequenceSetProperties target = (SequenceSetProperties) object;
97           target.setKey((java.lang.String) value);
98         } catch (java.lang.Exception ex)
99         {
100           throw new IllegalStateException(ex.toString());
101         }
102       }
103
104       public java.lang.Object newInstance(java.lang.Object parent)
105       {
106         return null;
107       }
108     };
109     desc.setHandler(handler);
110     desc.setMultivalued(false);
111     addFieldDescriptor(desc);
112
113     // -- validation code for: _key
114     fieldValidator = new org.exolab.castor.xml.FieldValidator();
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         SequenceSetProperties target = (SequenceSetProperties) 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           SequenceSetProperties target = (SequenceSetProperties) 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.setMultivalued(false);
156     addFieldDescriptor(desc);
157
158     // -- validation code for: _value
159     fieldValidator = new org.exolab.castor.xml.FieldValidator();
160     { // -- local scope
161       org.exolab.castor.xml.validators.StringValidator typeValidator;
162       typeValidator = new org.exolab.castor.xml.validators.StringValidator();
163       fieldValidator.setValidator(typeValidator);
164       typeValidator.setWhiteSpace("preserve");
165     }
166     desc.setValidator(fieldValidator);
167     // -- initialize element descriptors
168
169   }
170
171   // -----------/
172   // - Methods -/
173   // -----------/
174
175   /**
176    * Method getAccessMode.
177    * 
178    * @return the access mode specified for this class.
179    */
180   public org.exolab.castor.mapping.AccessMode getAccessMode()
181   {
182     return null;
183   }
184
185   /**
186    * Method getIdentity.
187    * 
188    * @return the identity field, null if this class has no identity.
189    */
190   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
191   {
192     return super.getIdentity();
193   }
194
195   /**
196    * Method getJavaClass.
197    * 
198    * @return the Java class represented by this descriptor.
199    */
200   public java.lang.Class getJavaClass()
201   {
202     return jalview.schemabinding.version2.SequenceSetProperties.class;
203   }
204
205   /**
206    * Method getNameSpacePrefix.
207    * 
208    * @return the namespace prefix to use when marshaling as XML.
209    */
210   public java.lang.String getNameSpacePrefix()
211   {
212     return _nsPrefix;
213   }
214
215   /**
216    * Method getNameSpaceURI.
217    * 
218    * @return the namespace URI used when marshaling and unmarshaling as XML.
219    */
220   public java.lang.String getNameSpaceURI()
221   {
222     return _nsURI;
223   }
224
225   /**
226    * Method getValidator.
227    * 
228    * @return a specific validator for the class described by this
229    *         ClassDescriptor.
230    */
231   public org.exolab.castor.xml.TypeValidator getValidator()
232   {
233     return this;
234   }
235
236   /**
237    * Method getXMLName.
238    * 
239    * @return the XML Name for the Class being described.
240    */
241   public java.lang.String getXMLName()
242   {
243     return _xmlName;
244   }
245
246   /**
247    * Method isElementDefinition.
248    * 
249    * @return true if XML schema definition of this Class is that of a global
250    *         element or element with anonymous type definition.
251    */
252   public boolean isElementDefinition()
253   {
254     return _elementDefinition;
255   }
256
257 }