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.Input;
\r
17 * Class InputDescriptor.
\r
19 * @version $Revision$ $Date$
\r
21 public class InputDescriptor extends uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor {
\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 InputDescriptor() {
\r
60 setExtendsWithoutFlatten(new uk.ac.vamsas.objects.core.descriptors.RangeTypeDescriptor());
\r
61 _nsURI = "http://www.vamsas.ac.uk/schemas/1.0/vamsasTypes";
\r
63 _elementDefinition = true;
\r
64 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
\r
65 org.exolab.castor.mapping.FieldHandler handler = null;
\r
66 org.exolab.castor.xml.FieldValidator fieldValidator = null;
\r
67 //-- initialize attribute descriptors
\r
70 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", org.exolab.castor.xml.NodeType.Attribute);
\r
71 desc.setImmutable(true);
\r
72 handler = new org.exolab.castor.xml.XMLFieldHandler() {
\r
73 public java.lang.Object getValue( java.lang.Object object )
\r
74 throws IllegalStateException
\r
76 Input target = (Input) object;
\r
77 return target.getName();
\r
79 public void setValue( java.lang.Object object, java.lang.Object value)
\r
80 throws IllegalStateException, IllegalArgumentException
\r
83 Input target = (Input) object;
\r
84 target.setName( (java.lang.String) value);
\r
85 } catch (java.lang.Exception ex) {
\r
86 throw new IllegalStateException(ex.toString());
\r
89 public java.lang.Object newInstance(java.lang.Object parent) {
\r
93 desc.setHandler(handler);
\r
94 desc.setRequired(true);
\r
95 desc.setMultivalued(false);
\r
96 addFieldDescriptor(desc);
\r
98 //-- validation code for: _name
\r
99 fieldValidator = new org.exolab.castor.xml.FieldValidator();
\r
100 fieldValidator.setMinOccurs(1);
\r
102 org.exolab.castor.xml.validators.StringValidator typeValidator;
\r
103 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
\r
104 fieldValidator.setValidator(typeValidator);
\r
105 typeValidator.setWhiteSpace("preserve");
\r
107 desc.setValidator(fieldValidator);
\r
109 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Object.class, "_objRef", "objRef", org.exolab.castor.xml.NodeType.Attribute);
\r
110 desc.setReference(true);
\r
111 handler = new org.exolab.castor.xml.XMLFieldHandler() {
\r
112 public java.lang.Object getValue( java.lang.Object object )
\r
113 throws IllegalStateException
\r
115 Input target = (Input) object;
\r
116 return target.getObjRef();
\r
118 public void setValue( java.lang.Object object, java.lang.Object value)
\r
119 throws IllegalStateException, IllegalArgumentException
\r
122 Input target = (Input) object;
\r
123 target.setObjRef( (java.lang.Object) value);
\r
124 } catch (java.lang.Exception ex) {
\r
125 throw new IllegalStateException(ex.toString());
\r
128 public java.lang.Object newInstance(java.lang.Object parent) {
\r
129 return new java.lang.Object();
\r
132 desc.setHandler(handler);
\r
133 desc.setMultivalued(false);
\r
134 addFieldDescriptor(desc);
\r
136 //-- validation code for: _objRef
\r
137 fieldValidator = new org.exolab.castor.xml.FieldValidator();
\r
139 org.exolab.castor.xml.validators.IdRefValidator typeValidator;
\r
140 typeValidator = new org.exolab.castor.xml.validators.IdRefValidator();
\r
141 fieldValidator.setValidator(typeValidator);
\r
143 desc.setValidator(fieldValidator);
\r
144 //-- initialize element descriptors
\r
154 * Method getAccessMode.
\r
156 * @return the access mode specified for this class.
\r
158 public org.exolab.castor.mapping.AccessMode getAccessMode(
\r
164 * Method getIdentity.
\r
166 * @return the identity field, null if this class has no
\r
169 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
\r
171 if (_identity == null) {
\r
172 return super.getIdentity();
\r
178 * Method getJavaClass.
\r
180 * @return the Java class represented by this descriptor.
\r
182 public java.lang.Class getJavaClass(
\r
184 return uk.ac.vamsas.objects.core.Input.class;
\r
188 * Method getNameSpacePrefix.
\r
190 * @return the namespace prefix to use when marshaling as XML.
\r
192 public java.lang.String getNameSpacePrefix(
\r
198 * Method getNameSpaceURI.
\r
200 * @return the namespace URI used when marshaling and
\r
201 * unmarshaling as XML.
\r
203 public java.lang.String getNameSpaceURI(
\r
209 * Method getValidator.
\r
211 * @return a specific validator for the class described by this
\r
214 public org.exolab.castor.xml.TypeValidator getValidator(
\r
220 * Method getXMLName.
\r
222 * @return the XML Name for the Class being described.
\r
224 public java.lang.String getXMLName(
\r
230 * Method isElementDefinition.
\r
232 * @return true if XML schema definition of this Class is that
\r
234 * element or element with anonymous type definition.
\r
236 public boolean isElementDefinition(
\r
238 return _elementDefinition;
\r