1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
3 * Copyright (C) 2014 The Jalview Authors
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.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2.descriptors;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import jalview.schemabinding.version2.StructureState;
36 * Class StructureStateDescriptor.
38 * @version $Revision$ $Date$
40 public class StructureStateDescriptor extends
41 org.exolab.castor.xml.util.XMLClassDescriptorImpl
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
49 * Field _elementDefinition.
51 private boolean _elementDefinition;
56 private java.lang.String _nsPrefix;
61 private java.lang.String _nsURI;
66 private java.lang.String _xmlName;
72 public StructureStateDescriptor()
75 _nsURI = "www.jalview.org";
76 _xmlName = "structureState";
77 _elementDefinition = true;
78 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
79 org.exolab.castor.mapping.FieldHandler handler = null;
80 org.exolab.castor.xml.FieldValidator fieldValidator = null;
82 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
83 java.lang.String.class, "_content", "PCDATA",
84 org.exolab.castor.xml.NodeType.Text);
85 desc.setImmutable(true);
86 handler = new org.exolab.castor.xml.XMLFieldHandler()
88 public java.lang.Object getValue(java.lang.Object object)
89 throws IllegalStateException
91 StructureState target = (StructureState) object;
92 return target.getContent();
95 public void setValue(java.lang.Object object, java.lang.Object value)
96 throws IllegalStateException, IllegalArgumentException
100 StructureState target = (StructureState) object;
101 target.setContent((java.lang.String) value);
102 } catch (java.lang.Exception ex)
104 throw new IllegalStateException(ex.toString());
108 public java.lang.Object newInstance(java.lang.Object parent)
113 desc.setHandler(handler);
114 addFieldDescriptor(desc);
116 // -- validation code for: _content
117 fieldValidator = new org.exolab.castor.xml.FieldValidator();
119 org.exolab.castor.xml.validators.StringValidator typeValidator;
120 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
121 fieldValidator.setValidator(typeValidator);
122 typeValidator.setWhiteSpace("preserve");
124 desc.setValidator(fieldValidator);
125 // -- initialize attribute descriptors
128 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
129 java.lang.Boolean.TYPE, "_visible", "visible",
130 org.exolab.castor.xml.NodeType.Attribute);
131 handler = new org.exolab.castor.xml.XMLFieldHandler()
133 public java.lang.Object getValue(java.lang.Object object)
134 throws IllegalStateException
136 StructureState target = (StructureState) object;
137 if (!target.hasVisible())
141 return (target.getVisible() ? java.lang.Boolean.TRUE
142 : java.lang.Boolean.FALSE);
145 public void setValue(java.lang.Object object, java.lang.Object value)
146 throws IllegalStateException, IllegalArgumentException
150 StructureState target = (StructureState) object;
151 // if null, use delete method for optional primitives
154 target.deleteVisible();
157 target.setVisible(((java.lang.Boolean) value).booleanValue());
158 } catch (java.lang.Exception ex)
160 throw new IllegalStateException(ex.toString());
164 public java.lang.Object newInstance(java.lang.Object parent)
169 desc.setHandler(handler);
170 desc.setMultivalued(false);
171 addFieldDescriptor(desc);
173 // -- validation code for: _visible
174 fieldValidator = new org.exolab.castor.xml.FieldValidator();
176 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
177 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
178 fieldValidator.setValidator(typeValidator);
180 desc.setValidator(fieldValidator);
182 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
183 java.lang.String.class, "_viewId", "viewId",
184 org.exolab.castor.xml.NodeType.Attribute);
185 desc.setImmutable(true);
186 handler = new org.exolab.castor.xml.XMLFieldHandler()
188 public java.lang.Object getValue(java.lang.Object object)
189 throws IllegalStateException
191 StructureState target = (StructureState) object;
192 return target.getViewId();
195 public void setValue(java.lang.Object object, java.lang.Object value)
196 throws IllegalStateException, IllegalArgumentException
200 StructureState target = (StructureState) object;
201 target.setViewId((java.lang.String) value);
202 } catch (java.lang.Exception ex)
204 throw new IllegalStateException(ex.toString());
208 public java.lang.Object newInstance(java.lang.Object parent)
213 desc.setHandler(handler);
214 desc.setMultivalued(false);
215 addFieldDescriptor(desc);
217 // -- validation code for: _viewId
218 fieldValidator = new org.exolab.castor.xml.FieldValidator();
220 org.exolab.castor.xml.validators.StringValidator typeValidator;
221 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
222 fieldValidator.setValidator(typeValidator);
223 typeValidator.setWhiteSpace("preserve");
225 desc.setValidator(fieldValidator);
226 // -- _alignwithAlignPanel
227 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
228 java.lang.Boolean.TYPE, "_alignwithAlignPanel",
229 "alignwithAlignPanel", org.exolab.castor.xml.NodeType.Attribute);
230 handler = new org.exolab.castor.xml.XMLFieldHandler()
232 public java.lang.Object getValue(java.lang.Object object)
233 throws IllegalStateException
235 StructureState target = (StructureState) object;
236 if (!target.hasAlignwithAlignPanel())
240 return (target.getAlignwithAlignPanel() ? java.lang.Boolean.TRUE
241 : java.lang.Boolean.FALSE);
244 public void setValue(java.lang.Object object, java.lang.Object value)
245 throws IllegalStateException, IllegalArgumentException
249 StructureState target = (StructureState) object;
250 // if null, use delete method for optional primitives
253 target.deleteAlignwithAlignPanel();
256 target.setAlignwithAlignPanel(((java.lang.Boolean) value)
258 } catch (java.lang.Exception ex)
260 throw new IllegalStateException(ex.toString());
264 public java.lang.Object newInstance(java.lang.Object parent)
269 desc.setHandler(handler);
270 desc.setMultivalued(false);
271 addFieldDescriptor(desc);
273 // -- validation code for: _alignwithAlignPanel
274 fieldValidator = new org.exolab.castor.xml.FieldValidator();
276 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
277 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
278 fieldValidator.setValidator(typeValidator);
280 desc.setValidator(fieldValidator);
281 // -- _colourwithAlignPanel
282 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
283 java.lang.Boolean.TYPE, "_colourwithAlignPanel",
284 "colourwithAlignPanel",
285 org.exolab.castor.xml.NodeType.Attribute);
286 handler = new org.exolab.castor.xml.XMLFieldHandler()
288 public java.lang.Object getValue(java.lang.Object object)
289 throws IllegalStateException
291 StructureState target = (StructureState) object;
292 if (!target.hasColourwithAlignPanel())
296 return (target.getColourwithAlignPanel() ? java.lang.Boolean.TRUE
297 : java.lang.Boolean.FALSE);
300 public void setValue(java.lang.Object object, java.lang.Object value)
301 throws IllegalStateException, IllegalArgumentException
305 StructureState target = (StructureState) object;
306 // if null, use delete method for optional primitives
309 target.deleteColourwithAlignPanel();
312 target.setColourwithAlignPanel(((java.lang.Boolean) value)
314 } catch (java.lang.Exception ex)
316 throw new IllegalStateException(ex.toString());
320 public java.lang.Object newInstance(java.lang.Object parent)
325 desc.setHandler(handler);
326 desc.setMultivalued(false);
327 addFieldDescriptor(desc);
329 // -- validation code for: _colourwithAlignPanel
330 fieldValidator = new org.exolab.castor.xml.FieldValidator();
332 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
333 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
334 fieldValidator.setValidator(typeValidator);
336 desc.setValidator(fieldValidator);
338 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
339 java.lang.Boolean.TYPE, "_colourByJmol", "colourByJmol",
340 org.exolab.castor.xml.NodeType.Attribute);
341 handler = new org.exolab.castor.xml.XMLFieldHandler()
343 public java.lang.Object getValue(java.lang.Object object)
344 throws IllegalStateException
346 StructureState target = (StructureState) object;
347 if (!target.hasColourByJmol())
351 return (target.getColourByJmol() ? java.lang.Boolean.TRUE
352 : java.lang.Boolean.FALSE);
355 public void setValue(java.lang.Object object, java.lang.Object value)
356 throws IllegalStateException, IllegalArgumentException
360 StructureState target = (StructureState) object;
361 // if null, use delete method for optional primitives
364 target.deleteColourByJmol();
367 target.setColourByJmol(((java.lang.Boolean) value).booleanValue());
368 } catch (java.lang.Exception ex)
370 throw new IllegalStateException(ex.toString());
374 public java.lang.Object newInstance(java.lang.Object parent)
379 desc.setHandler(handler);
380 desc.setMultivalued(false);
381 addFieldDescriptor(desc);
383 // -- validation code for: _colourByJmol
384 fieldValidator = new org.exolab.castor.xml.FieldValidator();
386 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
387 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
388 fieldValidator.setValidator(typeValidator);
390 desc.setValidator(fieldValidator);
392 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
393 java.lang.Integer.TYPE, "_width", "width",
394 org.exolab.castor.xml.NodeType.Attribute);
395 handler = new org.exolab.castor.xml.XMLFieldHandler()
397 public java.lang.Object getValue(java.lang.Object object)
398 throws IllegalStateException
400 StructureState target = (StructureState) object;
401 if (!target.hasWidth())
405 return new java.lang.Integer(target.getWidth());
408 public void setValue(java.lang.Object object, java.lang.Object value)
409 throws IllegalStateException, IllegalArgumentException
413 StructureState target = (StructureState) object;
414 // if null, use delete method for optional primitives
417 target.deleteWidth();
420 target.setWidth(((java.lang.Integer) value).intValue());
421 } catch (java.lang.Exception ex)
423 throw new IllegalStateException(ex.toString());
427 public java.lang.Object newInstance(java.lang.Object parent)
432 desc.setHandler(handler);
433 desc.setMultivalued(false);
434 addFieldDescriptor(desc);
436 // -- validation code for: _width
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(
448 java.lang.Integer.TYPE, "_height", "height",
449 org.exolab.castor.xml.NodeType.Attribute);
450 handler = new org.exolab.castor.xml.XMLFieldHandler()
452 public java.lang.Object getValue(java.lang.Object object)
453 throws IllegalStateException
455 StructureState target = (StructureState) object;
456 if (!target.hasHeight())
460 return new java.lang.Integer(target.getHeight());
463 public void setValue(java.lang.Object object, java.lang.Object value)
464 throws IllegalStateException, IllegalArgumentException
468 StructureState target = (StructureState) object;
469 // if null, use delete method for optional primitives
472 target.deleteHeight();
475 target.setHeight(((java.lang.Integer) value).intValue());
476 } catch (java.lang.Exception ex)
478 throw new IllegalStateException(ex.toString());
482 public java.lang.Object newInstance(java.lang.Object parent)
487 desc.setHandler(handler);
488 desc.setMultivalued(false);
489 addFieldDescriptor(desc);
491 // -- validation code for: _height
492 fieldValidator = new org.exolab.castor.xml.FieldValidator();
494 org.exolab.castor.xml.validators.IntValidator typeValidator;
495 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
496 fieldValidator.setValidator(typeValidator);
497 typeValidator.setMinInclusive(-2147483648);
498 typeValidator.setMaxInclusive(2147483647);
500 desc.setValidator(fieldValidator);
502 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
503 java.lang.Integer.TYPE, "_xpos", "xpos",
504 org.exolab.castor.xml.NodeType.Attribute);
505 handler = new org.exolab.castor.xml.XMLFieldHandler()
507 public java.lang.Object getValue(java.lang.Object object)
508 throws IllegalStateException
510 StructureState target = (StructureState) object;
511 if (!target.hasXpos())
515 return new java.lang.Integer(target.getXpos());
518 public void setValue(java.lang.Object object, java.lang.Object value)
519 throws IllegalStateException, IllegalArgumentException
523 StructureState target = (StructureState) object;
524 // if null, use delete method for optional primitives
530 target.setXpos(((java.lang.Integer) value).intValue());
531 } catch (java.lang.Exception ex)
533 throw new IllegalStateException(ex.toString());
537 public java.lang.Object newInstance(java.lang.Object parent)
542 desc.setHandler(handler);
543 desc.setMultivalued(false);
544 addFieldDescriptor(desc);
546 // -- validation code for: _xpos
547 fieldValidator = new org.exolab.castor.xml.FieldValidator();
549 org.exolab.castor.xml.validators.IntValidator typeValidator;
550 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
551 fieldValidator.setValidator(typeValidator);
552 typeValidator.setMinInclusive(-2147483648);
553 typeValidator.setMaxInclusive(2147483647);
555 desc.setValidator(fieldValidator);
557 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
558 java.lang.Integer.TYPE, "_ypos", "ypos",
559 org.exolab.castor.xml.NodeType.Attribute);
560 handler = new org.exolab.castor.xml.XMLFieldHandler()
562 public java.lang.Object getValue(java.lang.Object object)
563 throws IllegalStateException
565 StructureState target = (StructureState) object;
566 if (!target.hasYpos())
570 return new java.lang.Integer(target.getYpos());
573 public void setValue(java.lang.Object object, java.lang.Object value)
574 throws IllegalStateException, IllegalArgumentException
578 StructureState target = (StructureState) object;
579 // if null, use delete method for optional primitives
585 target.setYpos(((java.lang.Integer) value).intValue());
586 } catch (java.lang.Exception ex)
588 throw new IllegalStateException(ex.toString());
592 public java.lang.Object newInstance(java.lang.Object parent)
597 desc.setHandler(handler);
598 desc.setMultivalued(false);
599 addFieldDescriptor(desc);
601 // -- validation code for: _ypos
602 fieldValidator = new org.exolab.castor.xml.FieldValidator();
604 org.exolab.castor.xml.validators.IntValidator typeValidator;
605 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
606 fieldValidator.setValidator(typeValidator);
607 typeValidator.setMinInclusive(-2147483648);
608 typeValidator.setMaxInclusive(2147483647);
610 desc.setValidator(fieldValidator);
611 // -- initialize element descriptors
620 * Method getAccessMode.
622 * @return the access mode specified for this class.
624 public org.exolab.castor.mapping.AccessMode getAccessMode()
630 * Method getIdentity.
632 * @return the identity field, null if this class has no identity.
634 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
636 return super.getIdentity();
640 * Method getJavaClass.
642 * @return the Java class represented by this descriptor.
644 public java.lang.Class getJavaClass()
646 return jalview.schemabinding.version2.StructureState.class;
650 * Method getNameSpacePrefix.
652 * @return the namespace prefix to use when marshaling as XML.
654 public java.lang.String getNameSpacePrefix()
660 * Method getNameSpaceURI.
662 * @return the namespace URI used when marshaling and unmarshaling as XML.
664 public java.lang.String getNameSpaceURI()
670 * Method getValidator.
672 * @return a specific validator for the class described by this
675 public org.exolab.castor.xml.TypeValidator getValidator()
683 * @return the XML Name for the Class being described.
685 public java.lang.String getXMLName()
691 * Method isElementDefinition.
693 * @return true if XML schema definition of this Class is that of a global
694 * element or element with anonymous type definition.
696 public boolean isElementDefinition()
698 return _elementDefinition;