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.HiddenColumns;
34 * Class HiddenColumnsDescriptor.
36 * @version $Revision$ $Date$
38 public class HiddenColumnsDescriptor 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 HiddenColumnsDescriptor() {
72 _nsURI = "www.jalview.org";
73 _xmlName = "hiddenColumns";
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
81 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_start", "start", org.exolab.castor.xml.NodeType.Attribute);
82 handler = new org.exolab.castor.xml.XMLFieldHandler() {
83 public java.lang.Object getValue( java.lang.Object object )
84 throws IllegalStateException
86 HiddenColumns target = (HiddenColumns) object;
87 if (!target.hasStart()) { return null; }
88 return new java.lang.Integer(target.getStart());
90 public void setValue( java.lang.Object object, java.lang.Object value)
91 throws IllegalStateException, IllegalArgumentException
94 HiddenColumns target = (HiddenColumns) object;
95 // if null, use delete method for optional primitives
100 target.setStart( ((java.lang.Integer) value).intValue());
101 } catch (java.lang.Exception ex) {
102 throw new IllegalStateException(ex.toString());
105 public java.lang.Object newInstance(java.lang.Object parent) {
109 desc.setHandler(handler);
110 desc.setMultivalued(false);
111 addFieldDescriptor(desc);
113 //-- validation code for: _start
114 fieldValidator = new org.exolab.castor.xml.FieldValidator();
116 org.exolab.castor.xml.validators.IntValidator typeValidator;
117 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
118 fieldValidator.setValidator(typeValidator);
119 typeValidator.setMinInclusive(-2147483648);
120 typeValidator.setMaxInclusive(2147483647);
122 desc.setValidator(fieldValidator);
124 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_end", "end", org.exolab.castor.xml.NodeType.Attribute);
125 handler = new org.exolab.castor.xml.XMLFieldHandler() {
126 public java.lang.Object getValue( java.lang.Object object )
127 throws IllegalStateException
129 HiddenColumns target = (HiddenColumns) object;
130 if (!target.hasEnd()) { return null; }
131 return new java.lang.Integer(target.getEnd());
133 public void setValue( java.lang.Object object, java.lang.Object value)
134 throws IllegalStateException, IllegalArgumentException
137 HiddenColumns target = (HiddenColumns) object;
138 // if null, use delete method for optional primitives
143 target.setEnd( ((java.lang.Integer) value).intValue());
144 } catch (java.lang.Exception ex) {
145 throw new IllegalStateException(ex.toString());
148 public java.lang.Object newInstance(java.lang.Object parent) {
152 desc.setHandler(handler);
153 desc.setMultivalued(false);
154 addFieldDescriptor(desc);
156 //-- validation code for: _end
157 fieldValidator = new org.exolab.castor.xml.FieldValidator();
159 org.exolab.castor.xml.validators.IntValidator typeValidator;
160 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
161 fieldValidator.setValidator(typeValidator);
162 typeValidator.setMinInclusive(-2147483648);
163 typeValidator.setMaxInclusive(2147483647);
165 desc.setValidator(fieldValidator);
166 //-- initialize element descriptors
176 * Method getAccessMode.
178 * @return the access mode specified for this class.
180 public org.exolab.castor.mapping.AccessMode getAccessMode(
186 * Method getIdentity.
188 * @return the identity field, null if this class has no
191 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
193 return super.getIdentity();
197 * Method getJavaClass.
199 * @return the Java class represented by this descriptor.
201 public java.lang.Class getJavaClass(
203 return jalview.schemabinding.version2.HiddenColumns.class;
207 * Method getNameSpacePrefix.
209 * @return the namespace prefix to use when marshaling as XML.
211 public java.lang.String getNameSpacePrefix(
217 * Method getNameSpaceURI.
219 * @return the namespace URI used when marshaling and
220 * unmarshaling as XML.
222 public java.lang.String getNameSpaceURI(
228 * Method getValidator.
230 * @return a specific validator for the class described by this
233 public org.exolab.castor.xml.TypeValidator getValidator(
241 * @return the XML Name for the Class being described.
243 public java.lang.String getXMLName(
249 * Method isElementDefinition.
251 * @return true if XML schema definition of this Class is that
253 * element or element with anonymous type definition.
255 public boolean isElementDefinition(
257 return _elementDefinition;