update author list in license for (JAL-826)
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / GroupDescriptor.java
1 /*******************************************************************************
2  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3  * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
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  *******************************************************************************/
18 /*
19  * This class was automatically generated with 
20  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
21  * Schema.
22  * $Id$
23  */
24
25 package jalview.schemabinding.version2.descriptors;
26
27   //---------------------------------/
28  //- Imported classes and packages -/
29 //---------------------------------/
30
31 import jalview.schemabinding.version2.Group;
32
33 /**
34  * Class GroupDescriptor.
35  * 
36  * @version $Revision$ $Date$
37  */
38 public class GroupDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
39
40
41       //--------------------------/
42      //- Class/Member Variables -/
43     //--------------------------/
44
45     /**
46      * Field _elementDefinition.
47      */
48     private boolean _elementDefinition;
49
50     /**
51      * Field _nsPrefix.
52      */
53     private java.lang.String _nsPrefix;
54
55     /**
56      * Field _nsURI.
57      */
58     private java.lang.String _nsURI;
59
60     /**
61      * Field _xmlName.
62      */
63     private java.lang.String _xmlName;
64
65
66       //----------------/
67      //- Constructors -/
68     //----------------/
69
70     public GroupDescriptor() {
71         super();
72         _nsURI = "www.jalview.org";
73         _xmlName = "group";
74         _elementDefinition = true;
75         org.exolab.castor.xml.util.XMLFieldDescriptorImpl  desc           = null;
76         org.exolab.castor.mapping.FieldHandler             handler        = null;
77         org.exolab.castor.xml.FieldValidator               fieldValidator = null;
78         //-- initialize attribute descriptors
79         
80         //-- _name
81         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
82         desc.setImmutable(true);
83         handler = new org.exolab.castor.xml.XMLFieldHandler() {
84             public java.lang.Object getValue( java.lang.Object object ) 
85                 throws IllegalStateException
86             {
87                 Group target = (Group) object;
88                 return target.getName();
89             }
90             public void setValue( java.lang.Object object, java.lang.Object value) 
91                 throws IllegalStateException, IllegalArgumentException
92             {
93                 try {
94                     Group target = (Group) object;
95                     target.setName( (java.lang.String) value);
96                 } catch (java.lang.Exception ex) {
97                     throw new IllegalStateException(ex.toString());
98                 }
99             }
100             public java.lang.Object newInstance(java.lang.Object parent) {
101                 return null;
102             }
103         };
104         desc.setHandler(handler);
105         desc.setRequired(true);
106         desc.setMultivalued(false);
107         addFieldDescriptor(desc);
108         
109         //-- validation code for: _name
110         fieldValidator = new org.exolab.castor.xml.FieldValidator();
111         fieldValidator.setMinOccurs(1);
112         { //-- local scope
113             org.exolab.castor.xml.validators.StringValidator typeValidator;
114             typeValidator = new org.exolab.castor.xml.validators.StringValidator();
115             fieldValidator.setValidator(typeValidator);
116             typeValidator.setWhiteSpace("preserve");
117         }
118         desc.setValidator(fieldValidator);
119         //-- _display
120         desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_display", "display", org.exolab.castor.xml.NodeType.Attribute);
121         handler = new org.exolab.castor.xml.XMLFieldHandler() {
122             public java.lang.Object getValue( java.lang.Object object ) 
123                 throws IllegalStateException
124             {
125                 Group target = (Group) object;
126                 if (!target.hasDisplay()) { return null; }
127                 return (target.getDisplay() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
128             }
129             public void setValue( java.lang.Object object, java.lang.Object value) 
130                 throws IllegalStateException, IllegalArgumentException
131             {
132                 try {
133                     Group target = (Group) object;
134                     // ignore null values for non optional primitives
135                     if (value == null) { return; }
136                     
137                     target.setDisplay( ((java.lang.Boolean) value).booleanValue());
138                 } catch (java.lang.Exception ex) {
139                     throw new IllegalStateException(ex.toString());
140                 }
141             }
142             public java.lang.Object newInstance(java.lang.Object parent) {
143                 return null;
144             }
145         };
146         desc.setHandler(handler);
147         desc.setRequired(true);
148         desc.setMultivalued(false);
149         addFieldDescriptor(desc);
150         
151         //-- validation code for: _display
152         fieldValidator = new org.exolab.castor.xml.FieldValidator();
153         fieldValidator.setMinOccurs(1);
154         { //-- local scope
155             org.exolab.castor.xml.validators.BooleanValidator typeValidator;
156             typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
157             fieldValidator.setValidator(typeValidator);
158         }
159         desc.setValidator(fieldValidator);
160         //-- initialize element descriptors
161         
162     }
163
164
165       //-----------/
166      //- Methods -/
167     //-----------/
168
169     /**
170      * Method getAccessMode.
171      * 
172      * @return the access mode specified for this class.
173      */
174     public org.exolab.castor.mapping.AccessMode getAccessMode(
175     ) {
176         return null;
177     }
178
179     /**
180      * Method getIdentity.
181      * 
182      * @return the identity field, null if this class has no
183      * identity.
184      */
185     public org.exolab.castor.mapping.FieldDescriptor getIdentity(
186     ) {
187         return super.getIdentity();
188     }
189
190     /**
191      * Method getJavaClass.
192      * 
193      * @return the Java class represented by this descriptor.
194      */
195     public java.lang.Class getJavaClass(
196     ) {
197         return jalview.schemabinding.version2.Group.class;
198     }
199
200     /**
201      * Method getNameSpacePrefix.
202      * 
203      * @return the namespace prefix to use when marshaling as XML.
204      */
205     public java.lang.String getNameSpacePrefix(
206     ) {
207         return _nsPrefix;
208     }
209
210     /**
211      * Method getNameSpaceURI.
212      * 
213      * @return the namespace URI used when marshaling and
214      * unmarshaling as XML.
215      */
216     public java.lang.String getNameSpaceURI(
217     ) {
218         return _nsURI;
219     }
220
221     /**
222      * Method getValidator.
223      * 
224      * @return a specific validator for the class described by this
225      * ClassDescriptor.
226      */
227     public org.exolab.castor.xml.TypeValidator getValidator(
228     ) {
229         return this;
230     }
231
232     /**
233      * Method getXMLName.
234      * 
235      * @return the XML Name for the Class being described.
236      */
237     public java.lang.String getXMLName(
238     ) {
239         return _xmlName;
240     }
241
242     /**
243      * Method isElementDefinition.
244      * 
245      * @return true if XML schema definition of this Class is that
246      * of a global
247      * element or element with anonymous type definition.
248      */
249     public boolean isElementDefinition(
250     ) {
251         return _elementDefinition;
252     }
253
254 }