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.Colour;
15 import jalview.schemabinding.version2.JalviewUserColours;
18 * Class JalviewUserColoursDescriptor.
20 * @version $Revision$ $Date$
22 public class JalviewUserColoursDescriptor extends 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;
54 public JalviewUserColoursDescriptor() {
56 _nsURI = "www.jalview.org/colours";
57 _xmlName = "JalviewUserColours";
58 _elementDefinition = false;
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(java.lang.String.class, "_schemeName", "schemeName", org.exolab.castor.xml.NodeType.Attribute);
69 desc.setImmutable(true);
70 handler = new org.exolab.castor.xml.XMLFieldHandler() {
71 public java.lang.Object getValue( java.lang.Object object )
72 throws IllegalStateException
74 JalviewUserColours target = (JalviewUserColours) object;
75 return target.getSchemeName();
77 public void setValue( java.lang.Object object, java.lang.Object value)
78 throws IllegalStateException, IllegalArgumentException
81 JalviewUserColours target = (JalviewUserColours) object;
82 target.setSchemeName( (java.lang.String) value);
83 } catch (java.lang.Exception ex) {
84 throw new IllegalStateException(ex.toString());
87 public java.lang.Object newInstance(java.lang.Object parent) {
91 desc.setHandler(handler);
92 desc.setMultivalued(false);
93 addFieldDescriptor(desc);
95 //-- validation code for: _schemeName
96 fieldValidator = new org.exolab.castor.xml.FieldValidator();
98 org.exolab.castor.xml.validators.StringValidator typeValidator;
99 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
100 fieldValidator.setValidator(typeValidator);
101 typeValidator.setWhiteSpace("preserve");
103 desc.setValidator(fieldValidator);
104 //-- initialize element descriptors
107 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_version", "Version", org.exolab.castor.xml.NodeType.Element);
108 desc.setImmutable(true);
109 handler = new org.exolab.castor.xml.XMLFieldHandler() {
110 public java.lang.Object getValue( java.lang.Object object )
111 throws IllegalStateException
113 JalviewUserColours target = (JalviewUserColours) object;
114 return target.getVersion();
116 public void setValue( java.lang.Object object, java.lang.Object value)
117 throws IllegalStateException, IllegalArgumentException
120 JalviewUserColours target = (JalviewUserColours) object;
121 target.setVersion( (java.lang.String) value);
122 } catch (java.lang.Exception ex) {
123 throw new IllegalStateException(ex.toString());
126 public java.lang.Object newInstance(java.lang.Object parent) {
130 desc.setHandler(handler);
131 desc.setMultivalued(false);
132 addFieldDescriptor(desc);
134 //-- validation code for: _version
135 fieldValidator = new org.exolab.castor.xml.FieldValidator();
137 org.exolab.castor.xml.validators.StringValidator typeValidator;
138 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
139 fieldValidator.setValidator(typeValidator);
140 typeValidator.setWhiteSpace("preserve");
142 desc.setValidator(fieldValidator);
144 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(Colour.class, "_colourList", "colour", org.exolab.castor.xml.NodeType.Element);
145 handler = new org.exolab.castor.xml.XMLFieldHandler() {
146 public java.lang.Object getValue( java.lang.Object object )
147 throws IllegalStateException
149 JalviewUserColours target = (JalviewUserColours) object;
150 return target.getColour();
152 public void setValue( java.lang.Object object, java.lang.Object value)
153 throws IllegalStateException, IllegalArgumentException
156 JalviewUserColours target = (JalviewUserColours) object;
157 target.addColour( (Colour) value);
158 } catch (java.lang.Exception ex) {
159 throw new IllegalStateException(ex.toString());
162 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
164 JalviewUserColours target = (JalviewUserColours) object;
165 target.removeAllColour();
166 } catch (java.lang.Exception ex) {
167 throw new IllegalStateException(ex.toString());
170 public java.lang.Object newInstance(java.lang.Object parent) {
174 desc.setHandler(handler);
175 desc.setMultivalued(true);
176 addFieldDescriptor(desc);
178 //-- validation code for: _colourList
179 fieldValidator = new org.exolab.castor.xml.FieldValidator();
180 fieldValidator.setMinOccurs(0);
183 desc.setValidator(fieldValidator);
192 * Method getAccessMode.
194 * @return the access mode specified for this class.
196 public org.exolab.castor.mapping.AccessMode getAccessMode(
202 * Method getIdentity.
204 * @return the identity field, null if this class has no
207 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
209 return super.getIdentity();
213 * Method getJavaClass.
215 * @return the Java class represented by this descriptor.
217 public java.lang.Class getJavaClass(
219 return jalview.schemabinding.version2.JalviewUserColours.class;
223 * Method getNameSpacePrefix.
225 * @return the namespace prefix to use when marshaling as XML.
227 public java.lang.String getNameSpacePrefix(
233 * Method getNameSpaceURI.
235 * @return the namespace URI used when marshaling and
236 * unmarshaling as XML.
238 public java.lang.String getNameSpaceURI(
244 * Method getValidator.
246 * @return a specific validator for the class described by this
249 public org.exolab.castor.xml.TypeValidator getValidator(
257 * @return the XML Name for the Class being described.
259 public java.lang.String getXMLName(
265 * Method isElementDefinition.
267 * @return true if XML schema definition of this Class is that
269 * element or element with anonymous type definition.
271 public boolean isElementDefinition(
273 return _elementDefinition;