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.MappingChoice;
34 * Class MappingChoiceDescriptor.
36 * @version $Revision$ $Date$
38 public class MappingChoiceDescriptor 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 MappingChoiceDescriptor() {
72 _nsURI = "www.vamsas.ac.uk/jalview/version2";
73 _elementDefinition = false;
75 //-- set grouping compositor
76 setCompositorAsChoice();
77 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
78 org.exolab.castor.mapping.FieldHandler handler = null;
79 org.exolab.castor.xml.FieldValidator fieldValidator = null;
80 //-- initialize attribute descriptors
82 //-- initialize element descriptors
85 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Sequence.class, "_sequence", "Sequence", org.exolab.castor.xml.NodeType.Element);
86 handler = new org.exolab.castor.xml.XMLFieldHandler() {
87 public java.lang.Object getValue( java.lang.Object object )
88 throws IllegalStateException
90 MappingChoice target = (MappingChoice) object;
91 return target.getSequence();
93 public void setValue( java.lang.Object object, java.lang.Object value)
94 throws IllegalStateException, IllegalArgumentException
97 MappingChoice target = (MappingChoice) object;
98 target.setSequence( (jalview.schemabinding.version2.Sequence) value);
99 } catch (java.lang.Exception ex) {
100 throw new IllegalStateException(ex.toString());
103 public java.lang.Object newInstance(java.lang.Object parent) {
104 return new jalview.schemabinding.version2.Sequence();
107 desc.setHandler(handler);
108 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
109 desc.setMultivalued(false);
110 addFieldDescriptor(desc);
112 //-- validation code for: _sequence
113 fieldValidator = new org.exolab.castor.xml.FieldValidator();
116 desc.setValidator(fieldValidator);
118 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dseqFor", "dseqFor", org.exolab.castor.xml.NodeType.Element);
119 desc.setImmutable(true);
120 handler = new org.exolab.castor.xml.XMLFieldHandler() {
121 public java.lang.Object getValue( java.lang.Object object )
122 throws IllegalStateException
124 MappingChoice target = (MappingChoice) object;
125 return target.getDseqFor();
127 public void setValue( java.lang.Object object, java.lang.Object value)
128 throws IllegalStateException, IllegalArgumentException
131 MappingChoice target = (MappingChoice) object;
132 target.setDseqFor( (java.lang.String) value);
133 } catch (java.lang.Exception ex) {
134 throw new IllegalStateException(ex.toString());
137 public java.lang.Object newInstance(java.lang.Object parent) {
141 desc.setHandler(handler);
142 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
143 desc.setMultivalued(false);
144 addFieldDescriptor(desc);
146 //-- validation code for: _dseqFor
147 fieldValidator = new org.exolab.castor.xml.FieldValidator();
149 org.exolab.castor.xml.validators.StringValidator typeValidator;
150 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
151 fieldValidator.setValidator(typeValidator);
152 typeValidator.setWhiteSpace("preserve");
154 desc.setValidator(fieldValidator);
163 * Method getAccessMode.
165 * @return the access mode specified for this class.
167 public org.exolab.castor.mapping.AccessMode getAccessMode(
173 * Method getIdentity.
175 * @return the identity field, null if this class has no
178 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
180 return super.getIdentity();
184 * Method getJavaClass.
186 * @return the Java class represented by this descriptor.
188 public java.lang.Class getJavaClass(
190 return jalview.schemabinding.version2.MappingChoice.class;
194 * Method getNameSpacePrefix.
196 * @return the namespace prefix to use when marshaling as XML.
198 public java.lang.String getNameSpacePrefix(
204 * Method getNameSpaceURI.
206 * @return the namespace URI used when marshaling and
207 * unmarshaling as XML.
209 public java.lang.String getNameSpaceURI(
215 * Method getValidator.
217 * @return a specific validator for the class described by this
220 public org.exolab.castor.xml.TypeValidator getValidator(
228 * @return the XML Name for the Class being described.
230 public java.lang.String getXMLName(
236 * Method isElementDefinition.
238 * @return true if XML schema definition of this Class is that
240 * element or element with anonymous type definition.
242 public boolean isElementDefinition(
244 return _elementDefinition;