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
22 org.exolab.castor.xml.util.XMLClassDescriptorImpl
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
30 * Field _elementDefinition.
32 private boolean _elementDefinition;
37 private java.lang.String _nsPrefix;
42 private java.lang.String _nsURI;
47 private java.lang.String _xmlName;
53 public MappingChoiceDescriptor()
56 _nsURI = "www.vamsas.ac.uk/jalview/version2";
57 _elementDefinition = false;
59 // -- set grouping compositor
60 setCompositorAsChoice();
61 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
62 org.exolab.castor.mapping.FieldHandler handler = null;
63 org.exolab.castor.xml.FieldValidator fieldValidator = null;
64 // -- initialize attribute descriptors
66 // -- initialize element descriptors
69 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
70 jalview.schemabinding.version2.Sequence.class, "_sequence",
71 "Sequence", org.exolab.castor.xml.NodeType.Element);
72 handler = new org.exolab.castor.xml.XMLFieldHandler()
74 public java.lang.Object getValue(java.lang.Object object)
75 throws IllegalStateException
77 MappingChoice target = (MappingChoice) object;
78 return target.getSequence();
81 public void setValue(java.lang.Object object, java.lang.Object value)
82 throws IllegalStateException, IllegalArgumentException
86 MappingChoice target = (MappingChoice) object;
87 target.setSequence((jalview.schemabinding.version2.Sequence) value);
88 } catch (java.lang.Exception ex)
90 throw new IllegalStateException(ex.toString());
94 public java.lang.Object newInstance(java.lang.Object parent)
96 return new jalview.schemabinding.version2.Sequence();
99 desc.setHandler(handler);
100 desc.setNameSpaceURI("www.vamsas.ac.uk/jalview/version2");
101 desc.setMultivalued(false);
102 addFieldDescriptor(desc);
104 // -- validation code for: _sequence
105 fieldValidator = new org.exolab.castor.xml.FieldValidator();
108 desc.setValidator(fieldValidator);
110 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
111 java.lang.String.class, "_dseqFor", "dseqFor",
112 org.exolab.castor.xml.NodeType.Element);
113 desc.setImmutable(true);
114 handler = new org.exolab.castor.xml.XMLFieldHandler()
116 public java.lang.Object getValue(java.lang.Object object)
117 throws IllegalStateException
119 MappingChoice target = (MappingChoice) object;
120 return target.getDseqFor();
123 public void setValue(java.lang.Object object, java.lang.Object value)
124 throws IllegalStateException, IllegalArgumentException
128 MappingChoice target = (MappingChoice) object;
129 target.setDseqFor((java.lang.String) value);
130 } catch (java.lang.Exception ex)
132 throw new IllegalStateException(ex.toString());
136 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);
162 * Method getAccessMode.
164 * @return the access mode specified for this class.
166 public org.exolab.castor.mapping.AccessMode getAccessMode()
172 * Method getIdentity.
174 * @return the identity field, null if this class has no identity.
176 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
178 return super.getIdentity();
182 * Method getJavaClass.
184 * @return the Java class represented by this descriptor.
186 public java.lang.Class getJavaClass()
188 return jalview.schemabinding.version2.MappingChoice.class;
192 * Method getNameSpacePrefix.
194 * @return the namespace prefix to use when marshaling as XML.
196 public java.lang.String getNameSpacePrefix()
202 * Method getNameSpaceURI.
204 * @return the namespace URI used when marshaling and unmarshaling as XML.
206 public java.lang.String getNameSpaceURI()
212 * Method getValidator.
214 * @return a specific validator for the class described by this
217 public org.exolab.castor.xml.TypeValidator getValidator()
225 * @return the XML Name for the Class being described.
227 public java.lang.String getXMLName()
233 * Method isElementDefinition.
235 * @return true if XML schema definition of this Class is that of a global
236 * element or element with anonymous type definition.
238 public boolean isElementDefinition()
240 return _elementDefinition;