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
23 org.exolab.castor.xml.util.XMLClassDescriptorImpl
26 // --------------------------/
27 // - Class/Member Variables -/
28 // --------------------------/
31 * Field _elementDefinition.
33 private boolean _elementDefinition;
38 private java.lang.String _nsPrefix;
43 private java.lang.String _nsURI;
48 private java.lang.String _xmlName;
54 public JalviewUserColoursDescriptor()
57 _nsURI = "www.jalview.org/colours";
58 _xmlName = "JalviewUserColours";
59 _elementDefinition = false;
61 // -- set grouping compositor
62 setCompositorAsSequence();
63 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
64 org.exolab.castor.mapping.FieldHandler handler = null;
65 org.exolab.castor.xml.FieldValidator fieldValidator = null;
66 // -- initialize attribute descriptors
69 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
70 java.lang.String.class, "_schemeName", "schemeName",
71 org.exolab.castor.xml.NodeType.Attribute);
72 desc.setImmutable(true);
73 handler = new org.exolab.castor.xml.XMLFieldHandler()
75 public java.lang.Object getValue(java.lang.Object object)
76 throws IllegalStateException
78 JalviewUserColours target = (JalviewUserColours) object;
79 return target.getSchemeName();
82 public void setValue(java.lang.Object object, java.lang.Object value)
83 throws IllegalStateException, IllegalArgumentException
87 JalviewUserColours target = (JalviewUserColours) object;
88 target.setSchemeName((java.lang.String) value);
89 } catch (java.lang.Exception ex)
91 throw new IllegalStateException(ex.toString());
95 public java.lang.Object newInstance(java.lang.Object parent)
100 desc.setHandler(handler);
101 desc.setMultivalued(false);
102 addFieldDescriptor(desc);
104 // -- validation code for: _schemeName
105 fieldValidator = new org.exolab.castor.xml.FieldValidator();
107 org.exolab.castor.xml.validators.StringValidator typeValidator;
108 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
109 fieldValidator.setValidator(typeValidator);
110 typeValidator.setWhiteSpace("preserve");
112 desc.setValidator(fieldValidator);
113 // -- initialize element descriptors
116 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
117 java.lang.String.class, "_version", "Version",
118 org.exolab.castor.xml.NodeType.Element);
119 desc.setImmutable(true);
120 handler = new org.exolab.castor.xml.XMLFieldHandler()
122 public java.lang.Object getValue(java.lang.Object object)
123 throws IllegalStateException
125 JalviewUserColours target = (JalviewUserColours) object;
126 return target.getVersion();
129 public void setValue(java.lang.Object object, java.lang.Object value)
130 throws IllegalStateException, IllegalArgumentException
134 JalviewUserColours target = (JalviewUserColours) object;
135 target.setVersion((java.lang.String) value);
136 } catch (java.lang.Exception ex)
138 throw new IllegalStateException(ex.toString());
142 public java.lang.Object newInstance(java.lang.Object parent)
147 desc.setHandler(handler);
148 desc.setMultivalued(false);
149 addFieldDescriptor(desc);
151 // -- validation code for: _version
152 fieldValidator = new org.exolab.castor.xml.FieldValidator();
154 org.exolab.castor.xml.validators.StringValidator typeValidator;
155 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
156 fieldValidator.setValidator(typeValidator);
157 typeValidator.setWhiteSpace("preserve");
159 desc.setValidator(fieldValidator);
161 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
162 Colour.class, "_colourList", "colour",
163 org.exolab.castor.xml.NodeType.Element);
164 handler = new org.exolab.castor.xml.XMLFieldHandler()
166 public java.lang.Object getValue(java.lang.Object object)
167 throws IllegalStateException
169 JalviewUserColours target = (JalviewUserColours) object;
170 return target.getColour();
173 public void setValue(java.lang.Object object, java.lang.Object value)
174 throws IllegalStateException, IllegalArgumentException
178 JalviewUserColours target = (JalviewUserColours) object;
179 target.addColour((Colour) value);
180 } catch (java.lang.Exception ex)
182 throw new IllegalStateException(ex.toString());
186 public void resetValue(Object object) throws IllegalStateException,
187 IllegalArgumentException
191 JalviewUserColours target = (JalviewUserColours) object;
192 target.removeAllColour();
193 } catch (java.lang.Exception ex)
195 throw new IllegalStateException(ex.toString());
199 public java.lang.Object newInstance(java.lang.Object parent)
204 desc.setHandler(handler);
205 desc.setMultivalued(true);
206 addFieldDescriptor(desc);
208 // -- validation code for: _colourList
209 fieldValidator = new org.exolab.castor.xml.FieldValidator();
210 fieldValidator.setMinOccurs(0);
213 desc.setValidator(fieldValidator);
221 * Method getAccessMode.
223 * @return the access mode specified for this class.
225 public org.exolab.castor.mapping.AccessMode getAccessMode()
231 * Method getIdentity.
233 * @return the identity field, null if this class has no identity.
235 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
237 return super.getIdentity();
241 * Method getJavaClass.
243 * @return the Java class represented by this descriptor.
245 public java.lang.Class getJavaClass()
247 return jalview.schemabinding.version2.JalviewUserColours.class;
251 * Method getNameSpacePrefix.
253 * @return the namespace prefix to use when marshaling as XML.
255 public java.lang.String getNameSpacePrefix()
261 * Method getNameSpaceURI.
263 * @return the namespace URI used when marshaling and unmarshaling as XML.
265 public java.lang.String getNameSpaceURI()
271 * Method getValidator.
273 * @return a specific validator for the class described by this
276 public org.exolab.castor.xml.TypeValidator getValidator()
284 * @return the XML Name for the Class being described.
286 public java.lang.String getXMLName()
292 * Method isElementDefinition.
294 * @return true if XML schema definition of this Class is that of a global
295 * element or element with anonymous type definition.
297 public boolean isElementDefinition()
299 return _elementDefinition;