1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3 * Copyright (C) $(date) The Jalview Authors
5 * This file is part of Jalview.
7 * Jalview is free software: you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation, either version 3
10 * of the License, or (at your option) any later version.
12 * Jalview is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
19 * The Jalview Authors are detailed in the 'AUTHORS' file.
20 *******************************************************************************/
22 * This class was automatically generated with
23 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
28 package jalview.schemabinding.version2.descriptors;
30 //---------------------------------/
31 //- Imported classes and packages -/
32 //---------------------------------/
34 import jalview.schemabinding.version2.Colour;
35 import jalview.schemabinding.version2.JalviewUserColours;
38 * Class JalviewUserColoursDescriptor.
40 * @version $Revision$ $Date$
42 public class JalviewUserColoursDescriptor extends
43 org.exolab.castor.xml.util.XMLClassDescriptorImpl
46 // --------------------------/
47 // - Class/Member Variables -/
48 // --------------------------/
51 * Field _elementDefinition.
53 private boolean _elementDefinition;
58 private java.lang.String _nsPrefix;
63 private java.lang.String _nsURI;
68 private java.lang.String _xmlName;
74 public JalviewUserColoursDescriptor()
77 _nsURI = "www.jalview.org/colours";
78 _xmlName = "JalviewUserColours";
79 _elementDefinition = false;
81 // -- set grouping compositor
82 setCompositorAsSequence();
83 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
84 org.exolab.castor.mapping.FieldHandler handler = null;
85 org.exolab.castor.xml.FieldValidator fieldValidator = null;
86 // -- initialize attribute descriptors
89 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
90 java.lang.String.class, "_schemeName", "schemeName",
91 org.exolab.castor.xml.NodeType.Attribute);
92 desc.setImmutable(true);
93 handler = new org.exolab.castor.xml.XMLFieldHandler()
96 public java.lang.Object getValue(java.lang.Object object)
97 throws IllegalStateException
99 JalviewUserColours target = (JalviewUserColours) object;
100 return target.getSchemeName();
104 public void setValue(java.lang.Object object, java.lang.Object value)
105 throws IllegalStateException, IllegalArgumentException
109 JalviewUserColours target = (JalviewUserColours) object;
110 target.setSchemeName((java.lang.String) value);
111 } catch (java.lang.Exception ex)
113 throw new IllegalStateException(ex.toString());
118 public java.lang.Object newInstance(java.lang.Object parent)
123 desc.setHandler(handler);
124 desc.setMultivalued(false);
125 addFieldDescriptor(desc);
127 // -- validation code for: _schemeName
128 fieldValidator = new org.exolab.castor.xml.FieldValidator();
130 org.exolab.castor.xml.validators.StringValidator typeValidator;
131 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
132 fieldValidator.setValidator(typeValidator);
133 typeValidator.setWhiteSpace("preserve");
135 desc.setValidator(fieldValidator);
136 // -- initialize element descriptors
139 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
140 java.lang.String.class, "_version", "Version",
141 org.exolab.castor.xml.NodeType.Element);
142 desc.setImmutable(true);
143 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.getVersion();
154 public void setValue(java.lang.Object object, java.lang.Object value)
155 throws IllegalStateException, IllegalArgumentException
159 JalviewUserColours target = (JalviewUserColours) object;
160 target.setVersion((java.lang.String) value);
161 } catch (java.lang.Exception ex)
163 throw new IllegalStateException(ex.toString());
168 public java.lang.Object newInstance(java.lang.Object parent)
173 desc.setHandler(handler);
174 desc.setMultivalued(false);
175 addFieldDescriptor(desc);
177 // -- validation code for: _version
178 fieldValidator = new org.exolab.castor.xml.FieldValidator();
180 org.exolab.castor.xml.validators.StringValidator typeValidator;
181 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
182 fieldValidator.setValidator(typeValidator);
183 typeValidator.setWhiteSpace("preserve");
185 desc.setValidator(fieldValidator);
187 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
188 Colour.class, "_colourList", "colour",
189 org.exolab.castor.xml.NodeType.Element);
190 handler = new org.exolab.castor.xml.XMLFieldHandler()
193 public java.lang.Object getValue(java.lang.Object object)
194 throws IllegalStateException
196 JalviewUserColours target = (JalviewUserColours) object;
197 return target.getColour();
201 public void setValue(java.lang.Object object, java.lang.Object value)
202 throws IllegalStateException, IllegalArgumentException
206 JalviewUserColours target = (JalviewUserColours) object;
207 target.addColour((Colour) value);
208 } catch (java.lang.Exception ex)
210 throw new IllegalStateException(ex.toString());
215 public void resetValue(Object object) throws IllegalStateException,
216 IllegalArgumentException
220 JalviewUserColours target = (JalviewUserColours) object;
221 target.removeAllColour();
222 } catch (java.lang.Exception ex)
224 throw new IllegalStateException(ex.toString());
229 public java.lang.Object newInstance(java.lang.Object parent)
234 desc.setHandler(handler);
235 desc.setMultivalued(true);
236 addFieldDescriptor(desc);
238 // -- validation code for: _colourList
239 fieldValidator = new org.exolab.castor.xml.FieldValidator();
240 fieldValidator.setMinOccurs(0);
243 desc.setValidator(fieldValidator);
251 * Method getAccessMode.
253 * @return the access mode specified for this class.
256 public org.exolab.castor.mapping.AccessMode getAccessMode()
262 * Method getIdentity.
264 * @return the identity field, null if this class has no identity.
267 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
269 return super.getIdentity();
273 * Method getJavaClass.
275 * @return the Java class represented by this descriptor.
278 public java.lang.Class getJavaClass()
280 return jalview.schemabinding.version2.JalviewUserColours.class;
284 * Method getNameSpacePrefix.
286 * @return the namespace prefix to use when marshaling as XML.
289 public java.lang.String getNameSpacePrefix()
295 * Method getNameSpaceURI.
297 * @return the namespace URI used when marshaling and unmarshaling as XML.
300 public java.lang.String getNameSpaceURI()
306 * Method getValidator.
308 * @return a specific validator for the class described by this
312 public org.exolab.castor.xml.TypeValidator getValidator()
320 * @return the XML Name for the Class being described.
323 public java.lang.String getXMLName()
329 * Method isElementDefinition.
331 * @return true if XML schema definition of this Class is that of a global
332 * element or element with anonymous type definition.
335 public boolean isElementDefinition()
337 return _elementDefinition;