2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
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. If not, see <http://www.gnu.org/licenses/>.
17 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 package jalview.schemabinding.version2.descriptors;
21 //---------------------------------/
22 //- Imported classes and packages -/
23 //---------------------------------/
25 import jalview.schemabinding.version2.HiddenColumns;
28 * Class HiddenColumnsDescriptor.
30 * @version $Revision$ $Date$
32 public class HiddenColumnsDescriptor extends
33 org.exolab.castor.xml.util.XMLClassDescriptorImpl
36 // --------------------------/
37 // - Class/Member Variables -/
38 // --------------------------/
41 * Field _elementDefinition.
43 private boolean _elementDefinition;
48 private java.lang.String _nsPrefix;
53 private java.lang.String _nsURI;
58 private java.lang.String _xmlName;
64 public HiddenColumnsDescriptor()
67 _nsURI = "www.jalview.org";
68 _xmlName = "hiddenColumns";
69 _elementDefinition = true;
70 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
71 org.exolab.castor.mapping.FieldHandler handler = null;
72 org.exolab.castor.xml.FieldValidator fieldValidator = null;
73 // -- initialize attribute descriptors
76 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
77 java.lang.Integer.TYPE, "_start", "start",
78 org.exolab.castor.xml.NodeType.Attribute);
79 handler = new org.exolab.castor.xml.XMLFieldHandler()
81 public java.lang.Object getValue(java.lang.Object object)
82 throws IllegalStateException
84 HiddenColumns target = (HiddenColumns) object;
85 if (!target.hasStart())
89 return new java.lang.Integer(target.getStart());
92 public void setValue(java.lang.Object object, java.lang.Object value)
93 throws IllegalStateException, IllegalArgumentException
97 HiddenColumns target = (HiddenColumns) object;
98 // if null, use delete method for optional primitives
101 target.deleteStart();
104 target.setStart(((java.lang.Integer) value).intValue());
105 } catch (java.lang.Exception ex)
107 throw new IllegalStateException(ex.toString());
111 public java.lang.Object newInstance(java.lang.Object parent)
116 desc.setHandler(handler);
117 desc.setMultivalued(false);
118 addFieldDescriptor(desc);
120 // -- validation code for: _start
121 fieldValidator = new org.exolab.castor.xml.FieldValidator();
123 org.exolab.castor.xml.validators.IntValidator typeValidator;
124 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
125 fieldValidator.setValidator(typeValidator);
126 typeValidator.setMinInclusive(-2147483648);
127 typeValidator.setMaxInclusive(2147483647);
129 desc.setValidator(fieldValidator);
131 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
132 java.lang.Integer.TYPE, "_end", "end",
133 org.exolab.castor.xml.NodeType.Attribute);
134 handler = new org.exolab.castor.xml.XMLFieldHandler()
136 public java.lang.Object getValue(java.lang.Object object)
137 throws IllegalStateException
139 HiddenColumns target = (HiddenColumns) object;
140 if (!target.hasEnd())
144 return new java.lang.Integer(target.getEnd());
147 public void setValue(java.lang.Object object, java.lang.Object value)
148 throws IllegalStateException, IllegalArgumentException
152 HiddenColumns target = (HiddenColumns) object;
153 // if null, use delete method for optional primitives
159 target.setEnd(((java.lang.Integer) value).intValue());
160 } catch (java.lang.Exception ex)
162 throw new IllegalStateException(ex.toString());
166 public java.lang.Object newInstance(java.lang.Object parent)
171 desc.setHandler(handler);
172 desc.setMultivalued(false);
173 addFieldDescriptor(desc);
175 // -- validation code for: _end
176 fieldValidator = new org.exolab.castor.xml.FieldValidator();
178 org.exolab.castor.xml.validators.IntValidator typeValidator;
179 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
180 fieldValidator.setValidator(typeValidator);
181 typeValidator.setMinInclusive(-2147483648);
182 typeValidator.setMaxInclusive(2147483647);
184 desc.setValidator(fieldValidator);
185 // -- initialize element descriptors
194 * Method getAccessMode.
196 * @return the access mode specified for this class.
198 public org.exolab.castor.mapping.AccessMode getAccessMode()
204 * Method getIdentity.
206 * @return the identity field, null if this class has no identity.
208 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
210 return super.getIdentity();
214 * Method getJavaClass.
216 * @return the Java class represented by this descriptor.
218 public java.lang.Class getJavaClass()
220 return jalview.schemabinding.version2.HiddenColumns.class;
224 * Method getNameSpacePrefix.
226 * @return the namespace prefix to use when marshaling as XML.
228 public java.lang.String getNameSpacePrefix()
234 * Method getNameSpaceURI.
236 * @return the namespace URI used when marshaling and unmarshaling as XML.
238 public java.lang.String getNameSpaceURI()
244 * Method getValidator.
246 * @return a specific validator for the class described by this
249 public org.exolab.castor.xml.TypeValidator getValidator()
257 * @return the XML Name for the Class being described.
259 public java.lang.String getXMLName()
265 * Method isElementDefinition.
267 * @return true if XML schema definition of this Class is that of a global
268 * element or element with anonymous type definition.
270 public boolean isElementDefinition()
272 return _elementDefinition;