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.OtherData;
34 * Class OtherDataDescriptor.
36 * @version $Revision$ $Date$
38 public class OtherDataDescriptor 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 OtherDataDescriptor() {
72 _nsURI = "www.jalview.org";
73 _xmlName = "otherData";
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.String.class, "_key", "key", org.exolab.castor.xml.NodeType.Attribute);
82 desc.setImmutable(true);
83 handler = new org.exolab.castor.xml.XMLFieldHandler() {
84 public java.lang.Object getValue( java.lang.Object object )
85 throws IllegalStateException
87 OtherData target = (OtherData) object;
88 return target.getKey();
90 public void setValue( java.lang.Object object, java.lang.Object value)
91 throws IllegalStateException, IllegalArgumentException
94 OtherData target = (OtherData) object;
95 target.setKey( (java.lang.String) value);
96 } catch (java.lang.Exception ex) {
97 throw new IllegalStateException(ex.toString());
100 public java.lang.Object newInstance(java.lang.Object parent) {
104 desc.setHandler(handler);
105 desc.setRequired(true);
106 desc.setMultivalued(false);
107 addFieldDescriptor(desc);
109 //-- validation code for: _key
110 fieldValidator = new org.exolab.castor.xml.FieldValidator();
111 fieldValidator.setMinOccurs(1);
113 org.exolab.castor.xml.validators.StringValidator typeValidator;
114 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
115 fieldValidator.setValidator(typeValidator);
116 typeValidator.setWhiteSpace("preserve");
118 desc.setValidator(fieldValidator);
120 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", org.exolab.castor.xml.NodeType.Attribute);
121 desc.setImmutable(true);
122 handler = new org.exolab.castor.xml.XMLFieldHandler() {
123 public java.lang.Object getValue( java.lang.Object object )
124 throws IllegalStateException
126 OtherData target = (OtherData) object;
127 return target.getValue();
129 public void setValue( java.lang.Object object, java.lang.Object value)
130 throws IllegalStateException, IllegalArgumentException
133 OtherData target = (OtherData) object;
134 target.setValue( (java.lang.String) value);
135 } catch (java.lang.Exception ex) {
136 throw new IllegalStateException(ex.toString());
139 public java.lang.Object newInstance(java.lang.Object parent) {
143 desc.setHandler(handler);
144 desc.setRequired(true);
145 desc.setMultivalued(false);
146 addFieldDescriptor(desc);
148 //-- validation code for: _value
149 fieldValidator = new org.exolab.castor.xml.FieldValidator();
150 fieldValidator.setMinOccurs(1);
152 org.exolab.castor.xml.validators.StringValidator typeValidator;
153 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
154 fieldValidator.setValidator(typeValidator);
155 typeValidator.setWhiteSpace("preserve");
157 desc.setValidator(fieldValidator);
158 //-- initialize element descriptors
168 * Method getAccessMode.
170 * @return the access mode specified for this class.
172 public org.exolab.castor.mapping.AccessMode getAccessMode(
178 * Method getIdentity.
180 * @return the identity field, null if this class has no
183 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
185 return super.getIdentity();
189 * Method getJavaClass.
191 * @return the Java class represented by this descriptor.
193 public java.lang.Class getJavaClass(
195 return jalview.schemabinding.version2.OtherData.class;
199 * Method getNameSpacePrefix.
201 * @return the namespace prefix to use when marshaling as XML.
203 public java.lang.String getNameSpacePrefix(
209 * Method getNameSpaceURI.
211 * @return the namespace URI used when marshaling and
212 * unmarshaling as XML.
214 public java.lang.String getNameSpaceURI(
220 * Method getValidator.
222 * @return a specific validator for the class described by this
225 public org.exolab.castor.xml.TypeValidator getValidator(
233 * @return the XML Name for the Class being described.
235 public java.lang.String getXMLName(
241 * Method isElementDefinition.
243 * @return true if XML schema definition of this Class is that
245 * element or element with anonymous type definition.
247 public boolean isElementDefinition(
249 return _elementDefinition;