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
5 * This file is part of Jalview.
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.
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.
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 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2.descriptors;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import jalview.schemabinding.version2.StructureState;
34 * Class StructureStateDescriptor.
36 * @version $Revision$ $Date$
38 public class StructureStateDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
41 //--------------------------/
42 //- Class/Member Variables -/
43 //--------------------------/
46 * Field _elementDefinition.
48 private boolean _elementDefinition;
53 private java.lang.String _nsPrefix;
58 private java.lang.String _nsURI;
63 private java.lang.String _xmlName;
70 public StructureStateDescriptor() {
72 _nsURI = "www.jalview.org";
73 _xmlName = "structureState";
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;
79 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
80 desc.setImmutable(true);
81 handler = new org.exolab.castor.xml.XMLFieldHandler() {
82 public java.lang.Object getValue( java.lang.Object object )
83 throws IllegalStateException
85 StructureState target = (StructureState) object;
86 return target.getContent();
88 public void setValue( java.lang.Object object, java.lang.Object value)
89 throws IllegalStateException, IllegalArgumentException
92 StructureState target = (StructureState) object;
93 target.setContent( (java.lang.String) value);
94 } catch (java.lang.Exception ex) {
95 throw new IllegalStateException(ex.toString());
98 public java.lang.Object newInstance(java.lang.Object parent) {
102 desc.setHandler(handler);
103 addFieldDescriptor(desc);
105 //-- validation code for: _content
106 fieldValidator = new org.exolab.castor.xml.FieldValidator();
108 org.exolab.castor.xml.validators.StringValidator typeValidator;
109 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
110 fieldValidator.setValidator(typeValidator);
111 typeValidator.setWhiteSpace("preserve");
113 desc.setValidator(fieldValidator);
114 //-- initialize attribute descriptors
117 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_visible", "visible", org.exolab.castor.xml.NodeType.Attribute);
118 handler = new org.exolab.castor.xml.XMLFieldHandler() {
119 public java.lang.Object getValue( java.lang.Object object )
120 throws IllegalStateException
122 StructureState target = (StructureState) object;
123 if (!target.hasVisible()) { return null; }
124 return (target.getVisible() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
126 public void setValue( java.lang.Object object, java.lang.Object value)
127 throws IllegalStateException, IllegalArgumentException
130 StructureState target = (StructureState) object;
131 // if null, use delete method for optional primitives
133 target.deleteVisible();
136 target.setVisible( ((java.lang.Boolean) value).booleanValue());
137 } catch (java.lang.Exception ex) {
138 throw new IllegalStateException(ex.toString());
141 public java.lang.Object newInstance(java.lang.Object parent) {
145 desc.setHandler(handler);
146 desc.setMultivalued(false);
147 addFieldDescriptor(desc);
149 //-- validation code for: _visible
150 fieldValidator = new org.exolab.castor.xml.FieldValidator();
152 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
153 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
154 fieldValidator.setValidator(typeValidator);
156 desc.setValidator(fieldValidator);
158 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_viewId", "viewId", org.exolab.castor.xml.NodeType.Attribute);
159 desc.setImmutable(true);
160 handler = new org.exolab.castor.xml.XMLFieldHandler() {
161 public java.lang.Object getValue( java.lang.Object object )
162 throws IllegalStateException
164 StructureState target = (StructureState) object;
165 return target.getViewId();
167 public void setValue( java.lang.Object object, java.lang.Object value)
168 throws IllegalStateException, IllegalArgumentException
171 StructureState target = (StructureState) object;
172 target.setViewId( (java.lang.String) value);
173 } catch (java.lang.Exception ex) {
174 throw new IllegalStateException(ex.toString());
177 public java.lang.Object newInstance(java.lang.Object parent) {
181 desc.setHandler(handler);
182 desc.setMultivalued(false);
183 addFieldDescriptor(desc);
185 //-- validation code for: _viewId
186 fieldValidator = new org.exolab.castor.xml.FieldValidator();
188 org.exolab.castor.xml.validators.StringValidator typeValidator;
189 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
190 fieldValidator.setValidator(typeValidator);
191 typeValidator.setWhiteSpace("preserve");
193 desc.setValidator(fieldValidator);
194 //-- _alignwithAlignPanel
195 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_alignwithAlignPanel", "alignwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute);
196 handler = new org.exolab.castor.xml.XMLFieldHandler() {
197 public java.lang.Object getValue( java.lang.Object object )
198 throws IllegalStateException
200 StructureState target = (StructureState) object;
201 if (!target.hasAlignwithAlignPanel()) { return null; }
202 return (target.getAlignwithAlignPanel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
204 public void setValue( java.lang.Object object, java.lang.Object value)
205 throws IllegalStateException, IllegalArgumentException
208 StructureState target = (StructureState) object;
209 // if null, use delete method for optional primitives
211 target.deleteAlignwithAlignPanel();
214 target.setAlignwithAlignPanel( ((java.lang.Boolean) value).booleanValue());
215 } catch (java.lang.Exception ex) {
216 throw new IllegalStateException(ex.toString());
219 public java.lang.Object newInstance(java.lang.Object parent) {
223 desc.setHandler(handler);
224 desc.setMultivalued(false);
225 addFieldDescriptor(desc);
227 //-- validation code for: _alignwithAlignPanel
228 fieldValidator = new org.exolab.castor.xml.FieldValidator();
230 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
231 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
232 fieldValidator.setValidator(typeValidator);
234 desc.setValidator(fieldValidator);
235 //-- _colourwithAlignPanel
236 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourwithAlignPanel", "colourwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute);
237 handler = new org.exolab.castor.xml.XMLFieldHandler() {
238 public java.lang.Object getValue( java.lang.Object object )
239 throws IllegalStateException
241 StructureState target = (StructureState) object;
242 if (!target.hasColourwithAlignPanel()) { return null; }
243 return (target.getColourwithAlignPanel() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
245 public void setValue( java.lang.Object object, java.lang.Object value)
246 throws IllegalStateException, IllegalArgumentException
249 StructureState target = (StructureState) object;
250 // if null, use delete method for optional primitives
252 target.deleteColourwithAlignPanel();
255 target.setColourwithAlignPanel( ((java.lang.Boolean) value).booleanValue());
256 } catch (java.lang.Exception ex) {
257 throw new IllegalStateException(ex.toString());
260 public java.lang.Object newInstance(java.lang.Object parent) {
264 desc.setHandler(handler);
265 desc.setMultivalued(false);
266 addFieldDescriptor(desc);
268 //-- validation code for: _colourwithAlignPanel
269 fieldValidator = new org.exolab.castor.xml.FieldValidator();
271 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
272 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
273 fieldValidator.setValidator(typeValidator);
275 desc.setValidator(fieldValidator);
277 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_colourByJmol", "colourByJmol", org.exolab.castor.xml.NodeType.Attribute);
278 handler = new org.exolab.castor.xml.XMLFieldHandler() {
279 public java.lang.Object getValue( java.lang.Object object )
280 throws IllegalStateException
282 StructureState target = (StructureState) object;
283 if (!target.hasColourByJmol()) { return null; }
284 return (target.getColourByJmol() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
286 public void setValue( java.lang.Object object, java.lang.Object value)
287 throws IllegalStateException, IllegalArgumentException
290 StructureState target = (StructureState) object;
291 // if null, use delete method for optional primitives
293 target.deleteColourByJmol();
296 target.setColourByJmol( ((java.lang.Boolean) value).booleanValue());
297 } catch (java.lang.Exception ex) {
298 throw new IllegalStateException(ex.toString());
301 public java.lang.Object newInstance(java.lang.Object parent) {
305 desc.setHandler(handler);
306 desc.setMultivalued(false);
307 addFieldDescriptor(desc);
309 //-- validation code for: _colourByJmol
310 fieldValidator = new org.exolab.castor.xml.FieldValidator();
312 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
313 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
314 fieldValidator.setValidator(typeValidator);
316 desc.setValidator(fieldValidator);
318 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_width", "width", org.exolab.castor.xml.NodeType.Attribute);
319 handler = new org.exolab.castor.xml.XMLFieldHandler() {
320 public java.lang.Object getValue( java.lang.Object object )
321 throws IllegalStateException
323 StructureState target = (StructureState) object;
324 if (!target.hasWidth()) { return null; }
325 return new java.lang.Integer(target.getWidth());
327 public void setValue( java.lang.Object object, java.lang.Object value)
328 throws IllegalStateException, IllegalArgumentException
331 StructureState target = (StructureState) object;
332 // if null, use delete method for optional primitives
334 target.deleteWidth();
337 target.setWidth( ((java.lang.Integer) value).intValue());
338 } catch (java.lang.Exception ex) {
339 throw new IllegalStateException(ex.toString());
342 public java.lang.Object newInstance(java.lang.Object parent) {
346 desc.setHandler(handler);
347 desc.setMultivalued(false);
348 addFieldDescriptor(desc);
350 //-- validation code for: _width
351 fieldValidator = new org.exolab.castor.xml.FieldValidator();
353 org.exolab.castor.xml.validators.IntValidator typeValidator;
354 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
355 fieldValidator.setValidator(typeValidator);
356 typeValidator.setMinInclusive(-2147483648);
357 typeValidator.setMaxInclusive(2147483647);
359 desc.setValidator(fieldValidator);
361 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_height", "height", org.exolab.castor.xml.NodeType.Attribute);
362 handler = new org.exolab.castor.xml.XMLFieldHandler() {
363 public java.lang.Object getValue( java.lang.Object object )
364 throws IllegalStateException
366 StructureState target = (StructureState) object;
367 if (!target.hasHeight()) { return null; }
368 return new java.lang.Integer(target.getHeight());
370 public void setValue( java.lang.Object object, java.lang.Object value)
371 throws IllegalStateException, IllegalArgumentException
374 StructureState target = (StructureState) object;
375 // if null, use delete method for optional primitives
377 target.deleteHeight();
380 target.setHeight( ((java.lang.Integer) value).intValue());
381 } catch (java.lang.Exception ex) {
382 throw new IllegalStateException(ex.toString());
385 public java.lang.Object newInstance(java.lang.Object parent) {
389 desc.setHandler(handler);
390 desc.setMultivalued(false);
391 addFieldDescriptor(desc);
393 //-- validation code for: _height
394 fieldValidator = new org.exolab.castor.xml.FieldValidator();
396 org.exolab.castor.xml.validators.IntValidator typeValidator;
397 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
398 fieldValidator.setValidator(typeValidator);
399 typeValidator.setMinInclusive(-2147483648);
400 typeValidator.setMaxInclusive(2147483647);
402 desc.setValidator(fieldValidator);
404 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_xpos", "xpos", org.exolab.castor.xml.NodeType.Attribute);
405 handler = new org.exolab.castor.xml.XMLFieldHandler() {
406 public java.lang.Object getValue( java.lang.Object object )
407 throws IllegalStateException
409 StructureState target = (StructureState) object;
410 if (!target.hasXpos()) { return null; }
411 return new java.lang.Integer(target.getXpos());
413 public void setValue( java.lang.Object object, java.lang.Object value)
414 throws IllegalStateException, IllegalArgumentException
417 StructureState target = (StructureState) object;
418 // if null, use delete method for optional primitives
423 target.setXpos( ((java.lang.Integer) value).intValue());
424 } catch (java.lang.Exception ex) {
425 throw new IllegalStateException(ex.toString());
428 public java.lang.Object newInstance(java.lang.Object parent) {
432 desc.setHandler(handler);
433 desc.setMultivalued(false);
434 addFieldDescriptor(desc);
436 //-- validation code for: _xpos
437 fieldValidator = new org.exolab.castor.xml.FieldValidator();
439 org.exolab.castor.xml.validators.IntValidator typeValidator;
440 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
441 fieldValidator.setValidator(typeValidator);
442 typeValidator.setMinInclusive(-2147483648);
443 typeValidator.setMaxInclusive(2147483647);
445 desc.setValidator(fieldValidator);
447 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_ypos", "ypos", org.exolab.castor.xml.NodeType.Attribute);
448 handler = new org.exolab.castor.xml.XMLFieldHandler() {
449 public java.lang.Object getValue( java.lang.Object object )
450 throws IllegalStateException
452 StructureState target = (StructureState) object;
453 if (!target.hasYpos()) { return null; }
454 return new java.lang.Integer(target.getYpos());
456 public void setValue( java.lang.Object object, java.lang.Object value)
457 throws IllegalStateException, IllegalArgumentException
460 StructureState target = (StructureState) object;
461 // if null, use delete method for optional primitives
466 target.setYpos( ((java.lang.Integer) value).intValue());
467 } catch (java.lang.Exception ex) {
468 throw new IllegalStateException(ex.toString());
471 public java.lang.Object newInstance(java.lang.Object parent) {
475 desc.setHandler(handler);
476 desc.setMultivalued(false);
477 addFieldDescriptor(desc);
479 //-- validation code for: _ypos
480 fieldValidator = new org.exolab.castor.xml.FieldValidator();
482 org.exolab.castor.xml.validators.IntValidator typeValidator;
483 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
484 fieldValidator.setValidator(typeValidator);
485 typeValidator.setMinInclusive(-2147483648);
486 typeValidator.setMaxInclusive(2147483647);
488 desc.setValidator(fieldValidator);
489 //-- initialize element descriptors
499 * Method getAccessMode.
501 * @return the access mode specified for this class.
503 public org.exolab.castor.mapping.AccessMode getAccessMode(
509 * Method getIdentity.
511 * @return the identity field, null if this class has no
514 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
516 return super.getIdentity();
520 * Method getJavaClass.
522 * @return the Java class represented by this descriptor.
524 public java.lang.Class getJavaClass(
526 return jalview.schemabinding.version2.StructureState.class;
530 * Method getNameSpacePrefix.
532 * @return the namespace prefix to use when marshaling as XML.
534 public java.lang.String getNameSpacePrefix(
540 * Method getNameSpaceURI.
542 * @return the namespace URI used when marshaling and
543 * unmarshaling as XML.
545 public java.lang.String getNameSpaceURI(
551 * Method getValidator.
553 * @return a specific validator for the class described by this
556 public org.exolab.castor.xml.TypeValidator getValidator(
564 * @return the XML Name for the Class being described.
566 public java.lang.String getXMLName(
572 * Method isElementDefinition.
574 * @return true if XML schema definition of this Class is that
576 * element or element with anonymous type definition.
578 public boolean isElementDefinition(
580 return _elementDefinition;