2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2.descriptors;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import jalview.schemabinding.version2.MappingChoice;
17 * Class MappingChoiceDescriptor.
19 * @version $Revision$ $Date$
21 public class MappingChoiceDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
24 //--------------------------/
25 //- Class/Member Variables -/
26 //--------------------------/
29 * Field _elementDefinition.
31 private boolean _elementDefinition;
36 private java.lang.String _nsPrefix;
41 private java.lang.String _nsURI;
46 private java.lang.String _xmlName;
53 public MappingChoiceDescriptor() {
55 _nsURI = "www.vamsas.ac.uk/jalview/version2";
56 _elementDefinition = false;
58 //-- set grouping compositor
59 setCompositorAsChoice();
60 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
61 org.exolab.castor.mapping.FieldHandler handler = null;
62 org.exolab.castor.xml.FieldValidator fieldValidator = null;
63 //-- initialize attribute descriptors
65 //-- initialize element descriptors
68 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Sequence.class, "_sequence", "Sequence", org.exolab.castor.xml.NodeType.Element);
69 handler = new org.exolab.castor.xml.XMLFieldHandler() {
70 public java.lang.Object getValue( java.lang.Object object )
71 throws IllegalStateException
73 MappingChoice target = (MappingChoice) object;
74 return target.getSequence();
76 public void setValue( java.lang.Object object, java.lang.Object value)
77 throws IllegalStateException, IllegalArgumentException
80 MappingChoice target = (MappingChoice) object;
81 target.setSequence( (jalview.schemabinding.version2.Sequence) value);
82 } catch (java.lang.Exception ex) {
83 throw new IllegalStateException(ex.toString());
86 public java.lang.Object newInstance(java.lang.Object parent) {
87 return new jalview.schemabinding.version2.Sequence();
90 desc.setHandler(handler);
91 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
92 desc.setMultivalued(false);
93 addFieldDescriptor(desc);
95 //-- validation code for: _sequence
96 fieldValidator = new org.exolab.castor.xml.FieldValidator();
99 desc.setValidator(fieldValidator);
101 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_dseqFor", "dseqFor", org.exolab.castor.xml.NodeType.Element);
102 desc.setImmutable(true);
103 handler = new org.exolab.castor.xml.XMLFieldHandler() {
104 public java.lang.Object getValue( java.lang.Object object )
105 throws IllegalStateException
107 MappingChoice target = (MappingChoice) object;
108 return target.getDseqFor();
110 public void setValue( java.lang.Object object, java.lang.Object value)
111 throws IllegalStateException, IllegalArgumentException
114 MappingChoice target = (MappingChoice) object;
115 target.setDseqFor( (java.lang.String) value);
116 } catch (java.lang.Exception ex) {
117 throw new IllegalStateException(ex.toString());
120 public java.lang.Object newInstance(java.lang.Object parent) {
124 desc.setHandler(handler);
125 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
126 desc.setMultivalued(false);
127 addFieldDescriptor(desc);
129 //-- validation code for: _dseqFor
130 fieldValidator = new org.exolab.castor.xml.FieldValidator();
132 org.exolab.castor.xml.validators.StringValidator typeValidator;
133 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
134 fieldValidator.setValidator(typeValidator);
135 typeValidator.setWhiteSpace("preserve");
137 desc.setValidator(fieldValidator);
146 * Method getAccessMode.
148 * @return the access mode specified for this class.
150 public org.exolab.castor.mapping.AccessMode getAccessMode(
156 * Method getIdentity.
158 * @return the identity field, null if this class has no
161 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
163 return super.getIdentity();
167 * Method getJavaClass.
169 * @return the Java class represented by this descriptor.
171 public java.lang.Class getJavaClass(
173 return jalview.schemabinding.version2.MappingChoice.class;
177 * Method getNameSpacePrefix.
179 * @return the namespace prefix to use when marshaling as XML.
181 public java.lang.String getNameSpacePrefix(
187 * Method getNameSpaceURI.
189 * @return the namespace URI used when marshaling and
190 * unmarshaling as XML.
192 public java.lang.String getNameSpaceURI(
198 * Method getValidator.
200 * @return a specific validator for the class described by this
203 public org.exolab.castor.xml.TypeValidator getValidator(
211 * @return the XML Name for the Class being described.
213 public java.lang.String getXMLName(
219 * Method isElementDefinition.
221 * @return true if XML schema definition of this Class is that
223 * element or element with anonymous type definition.
225 public boolean isElementDefinition(
227 return _elementDefinition;