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.AlcodMap;
34 * Class AlcodMapDescriptor.
36 * @version $Revision$ $Date$
38 public class AlcodMapDescriptor 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 AlcodMapDescriptor() {
72 _nsURI = "www.vamsas.ac.uk/jalview/version2";
73 _xmlName = "alcodMap";
74 _elementDefinition = true;
76 //-- set grouping compositor
77 setCompositorAsSequence();
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;
81 //-- initialize attribute descriptors
84 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dnasq", "dnasq", org.exolab.castor.xml.NodeType.Attribute);
85 desc.setImmutable(true);
86 handler = new org.exolab.castor.xml.XMLFieldHandler() {
87 public java.lang.Object getValue( java.lang.Object object )
88 throws IllegalStateException
90 AlcodMap target = (AlcodMap) object;
91 return target.getDnasq();
93 public void setValue( java.lang.Object object, java.lang.Object value)
94 throws IllegalStateException, IllegalArgumentException
97 AlcodMap target = (AlcodMap) object;
98 target.setDnasq( (java.lang.String) value);
99 } catch (java.lang.Exception ex) {
100 throw new IllegalStateException(ex.toString());
103 public java.lang.Object newInstance(java.lang.Object parent) {
107 desc.setHandler(handler);
108 desc.setRequired(true);
109 desc.setMultivalued(false);
110 addFieldDescriptor(desc);
112 //-- validation code for: _dnasq
113 fieldValidator = new org.exolab.castor.xml.FieldValidator();
114 fieldValidator.setMinOccurs(1);
116 org.exolab.castor.xml.validators.StringValidator typeValidator;
117 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
118 fieldValidator.setValidator(typeValidator);
119 typeValidator.setWhiteSpace("preserve");
121 desc.setValidator(fieldValidator);
122 //-- initialize element descriptors
125 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Mapping.class, "_mapping", "Mapping", org.exolab.castor.xml.NodeType.Element);
126 handler = new org.exolab.castor.xml.XMLFieldHandler() {
127 public java.lang.Object getValue( java.lang.Object object )
128 throws IllegalStateException
130 AlcodMap target = (AlcodMap) object;
131 return target.getMapping();
133 public void setValue( java.lang.Object object, java.lang.Object value)
134 throws IllegalStateException, IllegalArgumentException
137 AlcodMap target = (AlcodMap) object;
138 target.setMapping( (jalview.schemabinding.version2.Mapping) value);
139 } catch (java.lang.Exception ex) {
140 throw new IllegalStateException(ex.toString());
143 public java.lang.Object newInstance(java.lang.Object parent) {
144 return new jalview.schemabinding.version2.Mapping();
147 desc.setHandler(handler);
148 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
149 desc.setRequired(true);
150 desc.setMultivalued(false);
151 addFieldDescriptor(desc);
153 //-- validation code for: _mapping
154 fieldValidator = new org.exolab.castor.xml.FieldValidator();
155 fieldValidator.setMinOccurs(1);
158 desc.setValidator(fieldValidator);
167 * Method getAccessMode.
169 * @return the access mode specified for this class.
171 public org.exolab.castor.mapping.AccessMode getAccessMode(
177 * Method getIdentity.
179 * @return the identity field, null if this class has no
182 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
184 return super.getIdentity();
188 * Method getJavaClass.
190 * @return the Java class represented by this descriptor.
192 public java.lang.Class getJavaClass(
194 return jalview.schemabinding.version2.AlcodMap.class;
198 * Method getNameSpacePrefix.
200 * @return the namespace prefix to use when marshaling as XML.
202 public java.lang.String getNameSpacePrefix(
208 * Method getNameSpaceURI.
210 * @return the namespace URI used when marshaling and
211 * unmarshaling as XML.
213 public java.lang.String getNameSpaceURI(
219 * Method getValidator.
221 * @return a specific validator for the class described by this
224 public org.exolab.castor.xml.TypeValidator getValidator(
232 * @return the XML Name for the Class being described.
234 public java.lang.String getXMLName(
240 * Method isElementDefinition.
242 * @return true if XML schema definition of this Class is that
244 * element or element with anonymous type definition.
246 public boolean isElementDefinition(
248 return _elementDefinition;