2 * This class was automatically generated with
\r
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
\r
8 package uk.ac.vamsas.objects.core.descriptors;
\r
10 //---------------------------------/
\r
11 //- Imported classes and packages -/
\r
12 //---------------------------------/
\r
14 import uk.ac.vamsas.objects.core.AlignmentAnnotation;
\r
17 * Class AlignmentAnnotationDescriptor.
\r
19 * @version $Revision$ $Date$
\r
21 public class AlignmentAnnotationDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor {
\r
24 //--------------------------/
\r
25 //- Class/Member Variables -/
\r
26 //--------------------------/
\r
29 * Field _elementDefinition.
\r
31 private boolean _elementDefinition;
\r
36 private java.lang.String _nsPrefix;
\r
41 private java.lang.String _nsURI;
\r
46 private java.lang.String _xmlName;
\r
51 private org.exolab.castor.xml.XMLFieldDescriptor _identity;
\r
58 public AlignmentAnnotationDescriptor() {
\r
60 setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeAnnotationDescriptor());
\r
61 _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
\r
62 _xmlName = "AlignmentAnnotation";
\r
63 _elementDefinition = true;
\r
65 //-- set grouping compositor
\r
66 setCompositorAsSequence();
\r
67 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
\r
68 org.exolab.castor.mapping.FieldHandler handler = null;
\r
69 org.exolab.castor.xml.FieldValidator fieldValidator = null;
\r
70 //-- initialize attribute descriptors
\r
73 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_graph", "graph", org.exolab.castor.xml.NodeType.Attribute);
\r
74 handler = new org.exolab.castor.xml.XMLFieldHandler() {
\r
75 public java.lang.Object getValue( java.lang.Object object )
\r
76 throws IllegalStateException
\r
78 AlignmentAnnotation target = (AlignmentAnnotation) object;
\r
79 if (!target.hasGraph()) { return null; }
\r
80 return (target.getGraph() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
\r
82 public void setValue( java.lang.Object object, java.lang.Object value)
\r
83 throws IllegalStateException, IllegalArgumentException
\r
86 AlignmentAnnotation target = (AlignmentAnnotation) object;
\r
87 // ignore null values for non optional primitives
\r
88 if (value == null) { return; }
\r
90 target.setGraph( ((java.lang.Boolean) value).booleanValue());
\r
91 } catch (java.lang.Exception ex) {
\r
92 throw new IllegalStateException(ex.toString());
\r
95 public java.lang.Object newInstance(java.lang.Object parent) {
\r
99 desc.setHandler(handler);
\r
100 desc.setRequired(true);
\r
101 desc.setMultivalued(false);
\r
102 addFieldDescriptor(desc);
\r
104 //-- validation code for: _graph
\r
105 fieldValidator = new org.exolab.castor.xml.FieldValidator();
\r
106 fieldValidator.setMinOccurs(1);
\r
108 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
\r
109 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
\r
110 fieldValidator.setValidator(typeValidator);
\r
112 desc.setValidator(fieldValidator);
\r
113 //-- initialize element descriptors
\r
116 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(uk.ac.vamsas.objects.core.Provenance.class, "_provenance", "Provenance", org.exolab.castor.xml.NodeType.Element);
\r
117 handler = new org.exolab.castor.xml.XMLFieldHandler() {
\r
118 public java.lang.Object getValue( java.lang.Object object )
\r
119 throws IllegalStateException
\r
121 AlignmentAnnotation target = (AlignmentAnnotation) object;
\r
122 return target.getProvenance();
\r
124 public void setValue( java.lang.Object object, java.lang.Object value)
\r
125 throws IllegalStateException, IllegalArgumentException
\r
128 AlignmentAnnotation target = (AlignmentAnnotation) object;
\r
129 target.setProvenance( (uk.ac.vamsas.objects.core.Provenance) value);
\r
130 } catch (java.lang.Exception ex) {
\r
131 throw new IllegalStateException(ex.toString());
\r
134 public java.lang.Object newInstance(java.lang.Object parent) {
\r
135 return new uk.ac.vamsas.objects.core.Provenance();
\r
138 desc.setHandler(handler);
\r
139 desc.setNameSpaceURI("http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes");
\r
140 desc.setRequired(true);
\r
141 desc.setMultivalued(false);
\r
142 addFieldDescriptor(desc);
\r
144 //-- validation code for: _provenance
\r
145 fieldValidator = new org.exolab.castor.xml.FieldValidator();
\r
146 fieldValidator.setMinOccurs(1);
\r
149 desc.setValidator(fieldValidator);
\r
158 * Method getAccessMode.
\r
160 * @return the access mode specified for this class.
\r
162 public org.exolab.castor.mapping.AccessMode getAccessMode(
\r
168 * Method getIdentity.
\r
170 * @return the identity field, null if this class has no
\r
173 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
\r
175 if (_identity == null) {
\r
176 return super.getIdentity();
\r
182 * Method getJavaClass.
\r
184 * @return the Java class represented by this descriptor.
\r
186 public java.lang.Class getJavaClass(
\r
188 return uk.ac.vamsas.objects.core.AlignmentAnnotation.class;
\r
192 * Method getNameSpacePrefix.
\r
194 * @return the namespace prefix to use when marshaling as XML.
\r
196 public java.lang.String getNameSpacePrefix(
\r
202 * Method getNameSpaceURI.
\r
204 * @return the namespace URI used when marshaling and
\r
205 * unmarshaling as XML.
\r
207 public java.lang.String getNameSpaceURI(
\r
213 * Method getValidator.
\r
215 * @return a specific validator for the class described by this
\r
218 public org.exolab.castor.xml.TypeValidator getValidator(
\r
224 * Method getXMLName.
\r
226 * @return the XML Name for the Class being described.
\r
228 public java.lang.String getXMLName(
\r
234 * Method isElementDefinition.
\r
236 * @return true if XML schema definition of this Class is that
\r
238 * element or element with anonymous type definition.
\r
240 public boolean isElementDefinition(
\r
242 return _elementDefinition;
\r