2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8)
3 * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, 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/>.
18 package jalview.schemabinding.version2.descriptors;
20 //---------------------------------/
21 //- Imported classes and packages -/
22 //---------------------------------/
24 import jalview.schemabinding.version2.HiddenColumns;
27 * Class HiddenColumnsDescriptor.
29 * @version $Revision$ $Date$
31 public class HiddenColumnsDescriptor extends
32 org.exolab.castor.xml.util.XMLClassDescriptorImpl
35 // --------------------------/
36 // - Class/Member Variables -/
37 // --------------------------/
40 * Field _elementDefinition.
42 private boolean _elementDefinition;
47 private java.lang.String _nsPrefix;
52 private java.lang.String _nsURI;
57 private java.lang.String _xmlName;
63 public HiddenColumnsDescriptor()
66 _nsURI = "www.jalview.org";
67 _xmlName = "hiddenColumns";
68 _elementDefinition = true;
69 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
70 org.exolab.castor.mapping.FieldHandler handler = null;
71 org.exolab.castor.xml.FieldValidator fieldValidator = null;
72 // -- initialize attribute descriptors
75 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
76 java.lang.Integer.TYPE, "_start", "start",
77 org.exolab.castor.xml.NodeType.Attribute);
78 handler = new org.exolab.castor.xml.XMLFieldHandler()
80 public java.lang.Object getValue(java.lang.Object object)
81 throws IllegalStateException
83 HiddenColumns target = (HiddenColumns) object;
84 if (!target.hasStart())
88 return new java.lang.Integer(target.getStart());
91 public void setValue(java.lang.Object object, java.lang.Object value)
92 throws IllegalStateException, IllegalArgumentException
96 HiddenColumns target = (HiddenColumns) object;
97 // if null, use delete method for optional primitives
100 target.deleteStart();
103 target.setStart(((java.lang.Integer) value).intValue());
104 } catch (java.lang.Exception ex)
106 throw new IllegalStateException(ex.toString());
110 public java.lang.Object newInstance(java.lang.Object parent)
115 desc.setHandler(handler);
116 desc.setMultivalued(false);
117 addFieldDescriptor(desc);
119 // -- validation code for: _start
120 fieldValidator = new org.exolab.castor.xml.FieldValidator();
122 org.exolab.castor.xml.validators.IntValidator typeValidator;
123 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
124 fieldValidator.setValidator(typeValidator);
125 typeValidator.setMinInclusive(-2147483648);
126 typeValidator.setMaxInclusive(2147483647);
128 desc.setValidator(fieldValidator);
130 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
131 java.lang.Integer.TYPE, "_end", "end",
132 org.exolab.castor.xml.NodeType.Attribute);
133 handler = new org.exolab.castor.xml.XMLFieldHandler()
135 public java.lang.Object getValue(java.lang.Object object)
136 throws IllegalStateException
138 HiddenColumns target = (HiddenColumns) object;
139 if (!target.hasEnd())
143 return new java.lang.Integer(target.getEnd());
146 public void setValue(java.lang.Object object, java.lang.Object value)
147 throws IllegalStateException, IllegalArgumentException
151 HiddenColumns target = (HiddenColumns) object;
152 // if null, use delete method for optional primitives
158 target.setEnd(((java.lang.Integer) value).intValue());
159 } catch (java.lang.Exception ex)
161 throw new IllegalStateException(ex.toString());
165 public java.lang.Object newInstance(java.lang.Object parent)
170 desc.setHandler(handler);
171 desc.setMultivalued(false);
172 addFieldDescriptor(desc);
174 // -- validation code for: _end
175 fieldValidator = new org.exolab.castor.xml.FieldValidator();
177 org.exolab.castor.xml.validators.IntValidator typeValidator;
178 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
179 fieldValidator.setValidator(typeValidator);
180 typeValidator.setMinInclusive(-2147483648);
181 typeValidator.setMaxInclusive(2147483647);
183 desc.setValidator(fieldValidator);
184 // -- initialize element descriptors
193 * Method getAccessMode.
195 * @return the access mode specified for this class.
197 public org.exolab.castor.mapping.AccessMode getAccessMode()
203 * Method getIdentity.
205 * @return the identity field, null if this class has no identity.
207 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
209 return super.getIdentity();
213 * Method getJavaClass.
215 * @return the Java class represented by this descriptor.
217 public java.lang.Class getJavaClass()
219 return jalview.schemabinding.version2.HiddenColumns.class;
223 * Method getNameSpacePrefix.
225 * @return the namespace prefix to use when marshaling as XML.
227 public java.lang.String getNameSpacePrefix()
233 * Method getNameSpaceURI.
235 * @return the namespace URI used when marshaling and unmarshaling as XML.
237 public java.lang.String getNameSpaceURI()
243 * Method getValidator.
245 * @return a specific validator for the class described by this
248 public org.exolab.castor.xml.TypeValidator getValidator()
256 * @return the XML Name for the Class being described.
258 public java.lang.String getXMLName()
264 * Method isElementDefinition.
266 * @return true if XML schema definition of this Class is that of a global
267 * element or element with anonymous type definition.
269 public boolean isElementDefinition()
271 return _elementDefinition;