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.UserColours;
17 * Class UserColoursDescriptor.
19 * @version $Revision$ $Date$
21 public class UserColoursDescriptor 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 UserColoursDescriptor() {
55 _nsURI = "www.jalview.org";
56 _xmlName = "UserColours";
57 _elementDefinition = true;
59 //-- set grouping compositor
60 setCompositorAsSequence();
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
67 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_id", "id", org.exolab.castor.xml.NodeType.Attribute);
68 desc.setImmutable(true);
69 handler = new org.exolab.castor.xml.XMLFieldHandler() {
70 public java.lang.Object getValue( java.lang.Object object )
71 throws IllegalStateException
73 UserColours target = (UserColours) object;
74 return target.getId();
76 public void setValue( java.lang.Object object, java.lang.Object value)
77 throws IllegalStateException, IllegalArgumentException
80 UserColours target = (UserColours) object;
81 target.setId( (java.lang.String) value);
82 } catch (java.lang.Exception ex) {
83 throw new IllegalStateException(ex.toString());
86 public java.lang.Object newInstance(java.lang.Object parent) {
90 desc.setHandler(handler);
91 desc.setMultivalued(false);
92 addFieldDescriptor(desc);
94 //-- validation code for: _id
95 fieldValidator = new org.exolab.castor.xml.FieldValidator();
97 org.exolab.castor.xml.validators.StringValidator typeValidator;
98 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
99 fieldValidator.setValidator(typeValidator);
100 typeValidator.setWhiteSpace("preserve");
102 desc.setValidator(fieldValidator);
103 //-- initialize element descriptors
105 //-- _userColourScheme
106 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.UserColourScheme.class, "_userColourScheme", "UserColourScheme", org.exolab.castor.xml.NodeType.Element);
107 handler = new org.exolab.castor.xml.XMLFieldHandler() {
108 public java.lang.Object getValue( java.lang.Object object )
109 throws IllegalStateException
111 UserColours target = (UserColours) object;
112 return target.getUserColourScheme();
114 public void setValue( java.lang.Object object, java.lang.Object value)
115 throws IllegalStateException, IllegalArgumentException
118 UserColours target = (UserColours) object;
119 target.setUserColourScheme( (jalview.schemabinding.version2.UserColourScheme) value);
120 } catch (java.lang.Exception ex) {
121 throw new IllegalStateException(ex.toString());
124 public java.lang.Object newInstance(java.lang.Object parent) {
125 return new jalview.schemabinding.version2.UserColourScheme();
128 desc.setHandler(handler);
129 desc.setNameSpaceURI("www.jalview.org");
130 desc.setRequired(true);
131 desc.setMultivalued(false);
132 addFieldDescriptor(desc);
134 //-- validation code for: _userColourScheme
135 fieldValidator = new org.exolab.castor.xml.FieldValidator();
136 fieldValidator.setMinOccurs(1);
139 desc.setValidator(fieldValidator);
148 * Method getAccessMode.
150 * @return the access mode specified for this class.
152 public org.exolab.castor.mapping.AccessMode getAccessMode(
158 * Method getIdentity.
160 * @return the identity field, null if this class has no
163 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
165 return super.getIdentity();
169 * Method getJavaClass.
171 * @return the Java class represented by this descriptor.
173 public java.lang.Class getJavaClass(
175 return jalview.schemabinding.version2.UserColours.class;
179 * Method getNameSpacePrefix.
181 * @return the namespace prefix to use when marshaling as XML.
183 public java.lang.String getNameSpacePrefix(
189 * Method getNameSpaceURI.
191 * @return the namespace URI used when marshaling and
192 * unmarshaling as XML.
194 public java.lang.String getNameSpaceURI(
200 * Method getValidator.
202 * @return a specific validator for the class described by this
205 public org.exolab.castor.xml.TypeValidator getValidator(
213 * @return the XML Name for the Class being described.
215 public java.lang.String getXMLName(
221 * Method isElementDefinition.
223 * @return true if XML schema definition of this Class is that
225 * element or element with anonymous type definition.
227 public boolean isElementDefinition(
229 return _elementDefinition;