1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, 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.Mapping;
34 * Class MappingDescriptor.
36 * @version $Revision$ $Date$
38 public class MappingDescriptor extends jalview.schemabinding.version2.descriptors.MapListTypeDescriptor {
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 MappingDescriptor() {
72 setExtendsWithoutFlatten(new jalview.schemabinding.version2.descriptors.MapListTypeDescriptor());
73 _nsURI = "www.vamsas.ac.uk/jalview/version2";
75 _elementDefinition = true;
77 //-- set grouping compositor
78 setCompositorAsChoice();
79 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
80 org.exolab.castor.mapping.FieldHandler handler = null;
81 org.exolab.castor.xml.FieldValidator fieldValidator = null;
82 //-- initialize attribute descriptors
84 //-- initialize element descriptors
87 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.MappingChoice.class, "_mappingChoice", "-error-if-this-is-used-", org.exolab.castor.xml.NodeType.Element);
88 handler = new org.exolab.castor.xml.XMLFieldHandler() {
89 public java.lang.Object getValue( java.lang.Object object )
90 throws IllegalStateException
92 Mapping target = (Mapping) object;
93 return target.getMappingChoice();
95 public void setValue( java.lang.Object object, java.lang.Object value)
96 throws IllegalStateException, IllegalArgumentException
99 Mapping target = (Mapping) object;
100 target.setMappingChoice( (jalview.schemabinding.version2.MappingChoice) value);
101 } catch (java.lang.Exception ex) {
102 throw new IllegalStateException(ex.toString());
105 public java.lang.Object newInstance(java.lang.Object parent) {
106 return new jalview.schemabinding.version2.MappingChoice();
109 desc.setHandler(handler);
110 desc.setContainer(true);
111 desc.setClassDescriptor(new jalview.schemabinding.version2.descriptors.MappingChoiceDescriptor());
112 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
113 desc.setMultivalued(false);
114 addFieldDescriptor(desc);
116 //-- validation code for: _mappingChoice
117 fieldValidator = new org.exolab.castor.xml.FieldValidator();
120 desc.setValidator(fieldValidator);
129 * Method getAccessMode.
131 * @return the access mode specified for this class.
133 public org.exolab.castor.mapping.AccessMode getAccessMode(
139 * Method getIdentity.
141 * @return the identity field, null if this class has no
144 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
146 return super.getIdentity();
150 * Method getJavaClass.
152 * @return the Java class represented by this descriptor.
154 public java.lang.Class getJavaClass(
156 return jalview.schemabinding.version2.Mapping.class;
160 * Method getNameSpacePrefix.
162 * @return the namespace prefix to use when marshaling as XML.
164 public java.lang.String getNameSpacePrefix(
170 * Method getNameSpaceURI.
172 * @return the namespace URI used when marshaling and
173 * unmarshaling as XML.
175 public java.lang.String getNameSpaceURI(
181 * Method getValidator.
183 * @return a specific validator for the class described by this
186 public org.exolab.castor.xml.TypeValidator getValidator(
194 * @return the XML Name for the Class being described.
196 public java.lang.String getXMLName(
202 * Method isElementDefinition.
204 * @return true if XML schema definition of this Class is that
206 * element or element with anonymous type definition.
208 public boolean isElementDefinition(
210 return _elementDefinition;