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.OtherData;
17 * Class OtherDataDescriptor.
19 * @version $Revision$ $Date$
21 public class OtherDataDescriptor 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 OtherDataDescriptor() {
55 _nsURI = "www.jalview.org";
56 _xmlName = "otherData";
57 _elementDefinition = true;
58 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
59 org.exolab.castor.mapping.FieldHandler handler = null;
60 org.exolab.castor.xml.FieldValidator fieldValidator = null;
61 //-- initialize attribute descriptors
64 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_key", "key", org.exolab.castor.xml.NodeType.Attribute);
65 desc.setImmutable(true);
66 handler = new org.exolab.castor.xml.XMLFieldHandler() {
67 public java.lang.Object getValue( java.lang.Object object )
68 throws IllegalStateException
70 OtherData target = (OtherData) object;
71 return target.getKey();
73 public void setValue( java.lang.Object object, java.lang.Object value)
74 throws IllegalStateException, IllegalArgumentException
77 OtherData target = (OtherData) object;
78 target.setKey( (java.lang.String) value);
79 } catch (java.lang.Exception ex) {
80 throw new IllegalStateException(ex.toString());
83 public java.lang.Object newInstance(java.lang.Object parent) {
87 desc.setHandler(handler);
88 desc.setRequired(true);
89 desc.setMultivalued(false);
90 addFieldDescriptor(desc);
92 //-- validation code for: _key
93 fieldValidator = new org.exolab.castor.xml.FieldValidator();
94 fieldValidator.setMinOccurs(1);
96 org.exolab.castor.xml.validators.StringValidator typeValidator;
97 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
98 fieldValidator.setValidator(typeValidator);
99 typeValidator.setWhiteSpace("preserve");
101 desc.setValidator(fieldValidator);
103 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_value", "value", org.exolab.castor.xml.NodeType.Attribute);
104 desc.setImmutable(true);
105 handler = new org.exolab.castor.xml.XMLFieldHandler() {
106 public java.lang.Object getValue( java.lang.Object object )
107 throws IllegalStateException
109 OtherData target = (OtherData) object;
110 return target.getValue();
112 public void setValue( java.lang.Object object, java.lang.Object value)
113 throws IllegalStateException, IllegalArgumentException
116 OtherData target = (OtherData) object;
117 target.setValue( (java.lang.String) value);
118 } catch (java.lang.Exception ex) {
119 throw new IllegalStateException(ex.toString());
122 public java.lang.Object newInstance(java.lang.Object parent) {
126 desc.setHandler(handler);
127 desc.setRequired(true);
128 desc.setMultivalued(false);
129 addFieldDescriptor(desc);
131 //-- validation code for: _value
132 fieldValidator = new org.exolab.castor.xml.FieldValidator();
133 fieldValidator.setMinOccurs(1);
135 org.exolab.castor.xml.validators.StringValidator typeValidator;
136 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
137 fieldValidator.setValidator(typeValidator);
138 typeValidator.setWhiteSpace("preserve");
140 desc.setValidator(fieldValidator);
141 //-- initialize element descriptors
151 * Method getAccessMode.
153 * @return the access mode specified for this class.
155 public org.exolab.castor.mapping.AccessMode getAccessMode(
161 * Method getIdentity.
163 * @return the identity field, null if this class has no
166 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
168 return super.getIdentity();
172 * Method getJavaClass.
174 * @return the Java class represented by this descriptor.
176 public java.lang.Class getJavaClass(
178 return jalview.schemabinding.version2.OtherData.class;
182 * Method getNameSpacePrefix.
184 * @return the namespace prefix to use when marshaling as XML.
186 public java.lang.String getNameSpacePrefix(
192 * Method getNameSpaceURI.
194 * @return the namespace URI used when marshaling and
195 * unmarshaling as XML.
197 public java.lang.String getNameSpaceURI(
203 * Method getValidator.
205 * @return a specific validator for the class described by this
208 public org.exolab.castor.xml.TypeValidator getValidator(
216 * @return the XML Name for the Class being described.
218 public java.lang.String getXMLName(
224 * Method isElementDefinition.
226 * @return true if XML schema definition of this Class is that
228 * element or element with anonymous type definition.
230 public boolean isElementDefinition(
232 return _elementDefinition;