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
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 UserColoursDescriptor()
56 _nsURI = "www.jalview.org";
57 _xmlName = "UserColours";
58 _elementDefinition = true;
60 // -- set grouping compositor
61 setCompositorAsSequence();
62 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63 org.exolab.castor.mapping.FieldHandler handler = null;
64 org.exolab.castor.xml.FieldValidator fieldValidator = null;
65 // -- initialize attribute descriptors
68 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
69 java.lang.String.class, "_id", "id",
70 org.exolab.castor.xml.NodeType.Attribute);
71 desc.setImmutable(true);
72 handler = new org.exolab.castor.xml.XMLFieldHandler()
74 public java.lang.Object getValue(java.lang.Object object)
75 throws IllegalStateException
77 UserColours target = (UserColours) object;
78 return target.getId();
81 public void setValue(java.lang.Object object, java.lang.Object value)
82 throws IllegalStateException, IllegalArgumentException
86 UserColours target = (UserColours) object;
87 target.setId((java.lang.String) value);
88 } catch (java.lang.Exception ex)
90 throw new IllegalStateException(ex.toString());
94 public java.lang.Object newInstance(java.lang.Object parent)
99 desc.setHandler(handler);
100 desc.setMultivalued(false);
101 addFieldDescriptor(desc);
103 // -- validation code for: _id
104 fieldValidator = new org.exolab.castor.xml.FieldValidator();
106 org.exolab.castor.xml.validators.StringValidator typeValidator;
107 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
108 fieldValidator.setValidator(typeValidator);
109 typeValidator.setWhiteSpace("preserve");
111 desc.setValidator(fieldValidator);
112 // -- initialize element descriptors
114 // -- _userColourScheme
115 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
116 jalview.schemabinding.version2.UserColourScheme.class,
117 "_userColourScheme", "UserColourScheme",
118 org.exolab.castor.xml.NodeType.Element);
119 handler = new org.exolab.castor.xml.XMLFieldHandler()
121 public java.lang.Object getValue(java.lang.Object object)
122 throws IllegalStateException
124 UserColours target = (UserColours) object;
125 return target.getUserColourScheme();
128 public void setValue(java.lang.Object object, java.lang.Object value)
129 throws IllegalStateException, IllegalArgumentException
133 UserColours target = (UserColours) object;
134 target.setUserColourScheme((jalview.schemabinding.version2.UserColourScheme) value);
135 } catch (java.lang.Exception ex)
137 throw new IllegalStateException(ex.toString());
141 public java.lang.Object newInstance(java.lang.Object parent)
143 return new jalview.schemabinding.version2.UserColourScheme();
146 desc.setHandler(handler);
147 desc.setNameSpaceURI("www.jalview.org");
148 desc.setRequired(true);
149 desc.setMultivalued(false);
150 addFieldDescriptor(desc);
152 // -- validation code for: _userColourScheme
153 fieldValidator = new org.exolab.castor.xml.FieldValidator();
154 fieldValidator.setMinOccurs(1);
157 desc.setValidator(fieldValidator);
165 * Method getAccessMode.
167 * @return the access mode specified for this class.
169 public org.exolab.castor.mapping.AccessMode getAccessMode()
175 * Method getIdentity.
177 * @return the identity field, null if this class has no identity.
179 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
181 return super.getIdentity();
185 * Method getJavaClass.
187 * @return the Java class represented by this descriptor.
189 public java.lang.Class getJavaClass()
191 return jalview.schemabinding.version2.UserColours.class;
195 * Method getNameSpacePrefix.
197 * @return the namespace prefix to use when marshaling as XML.
199 public java.lang.String getNameSpacePrefix()
205 * Method getNameSpaceURI.
207 * @return the namespace URI used when marshaling and unmarshaling as XML.
209 public java.lang.String getNameSpaceURI()
215 * Method getValidator.
217 * @return a specific validator for the class described by this
220 public org.exolab.castor.xml.TypeValidator getValidator()
228 * @return the XML Name for the Class being described.
230 public java.lang.String getXMLName()
236 * Method isElementDefinition.
238 * @return true if XML schema definition of this Class is that of a global
239 * element or element with anonymous type definition.
241 public boolean isElementDefinition()
243 return _elementDefinition;