1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.0b1)
3 * Copyright (C) 2014 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 of the License, or (at your option) any later version.
11 * Jalview is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 * PURPOSE. See the GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along with Jalview.
17 * If not, see <http://www.gnu.org/licenses/>.
18 * The Jalview Authors are detailed in the 'AUTHORS' file.
19 ******************************************************************************/
21 * This class was automatically generated with
22 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
27 package jalview.schemabinding.version2.descriptors;
29 //---------------------------------/
30 //- Imported classes and packages -/
31 //---------------------------------/
33 import jalview.schemabinding.version2.Colour;
34 import jalview.schemabinding.version2.JalviewUserColours;
37 * Class JalviewUserColoursDescriptor.
39 * @version $Revision$ $Date$
41 public class JalviewUserColoursDescriptor extends
42 org.exolab.castor.xml.util.XMLClassDescriptorImpl
45 // --------------------------/
46 // - Class/Member Variables -/
47 // --------------------------/
50 * Field _elementDefinition.
52 private boolean _elementDefinition;
57 private java.lang.String _nsPrefix;
62 private java.lang.String _nsURI;
67 private java.lang.String _xmlName;
73 public JalviewUserColoursDescriptor()
76 _nsURI = "www.jalview.org/colours";
77 _xmlName = "JalviewUserColours";
78 _elementDefinition = false;
80 // -- set grouping compositor
81 setCompositorAsSequence();
82 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
83 org.exolab.castor.mapping.FieldHandler handler = null;
84 org.exolab.castor.xml.FieldValidator fieldValidator = null;
85 // -- initialize attribute descriptors
88 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
89 java.lang.String.class, "_schemeName", "schemeName",
90 org.exolab.castor.xml.NodeType.Attribute);
91 desc.setImmutable(true);
92 handler = new org.exolab.castor.xml.XMLFieldHandler()
94 public java.lang.Object getValue(java.lang.Object object)
95 throws IllegalStateException
97 JalviewUserColours target = (JalviewUserColours) object;
98 return target.getSchemeName();
101 public void setValue(java.lang.Object object, java.lang.Object value)
102 throws IllegalStateException, IllegalArgumentException
106 JalviewUserColours target = (JalviewUserColours) object;
107 target.setSchemeName((java.lang.String) value);
108 } catch (java.lang.Exception ex)
110 throw new IllegalStateException(ex.toString());
114 public java.lang.Object newInstance(java.lang.Object parent)
119 desc.setHandler(handler);
120 desc.setMultivalued(false);
121 addFieldDescriptor(desc);
123 // -- validation code for: _schemeName
124 fieldValidator = new org.exolab.castor.xml.FieldValidator();
126 org.exolab.castor.xml.validators.StringValidator typeValidator;
127 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
128 fieldValidator.setValidator(typeValidator);
129 typeValidator.setWhiteSpace("preserve");
131 desc.setValidator(fieldValidator);
132 // -- initialize element descriptors
135 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
136 java.lang.String.class, "_version", "Version",
137 org.exolab.castor.xml.NodeType.Element);
138 desc.setImmutable(true);
139 handler = new org.exolab.castor.xml.XMLFieldHandler()
141 public java.lang.Object getValue(java.lang.Object object)
142 throws IllegalStateException
144 JalviewUserColours target = (JalviewUserColours) object;
145 return target.getVersion();
148 public void setValue(java.lang.Object object, java.lang.Object value)
149 throws IllegalStateException, IllegalArgumentException
153 JalviewUserColours target = (JalviewUserColours) object;
154 target.setVersion((java.lang.String) value);
155 } catch (java.lang.Exception ex)
157 throw new IllegalStateException(ex.toString());
161 public java.lang.Object newInstance(java.lang.Object parent)
166 desc.setHandler(handler);
167 desc.setMultivalued(false);
168 addFieldDescriptor(desc);
170 // -- validation code for: _version
171 fieldValidator = new org.exolab.castor.xml.FieldValidator();
173 org.exolab.castor.xml.validators.StringValidator typeValidator;
174 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
175 fieldValidator.setValidator(typeValidator);
176 typeValidator.setWhiteSpace("preserve");
178 desc.setValidator(fieldValidator);
180 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
181 Colour.class, "_colourList", "colour",
182 org.exolab.castor.xml.NodeType.Element);
183 handler = new org.exolab.castor.xml.XMLFieldHandler()
185 public java.lang.Object getValue(java.lang.Object object)
186 throws IllegalStateException
188 JalviewUserColours target = (JalviewUserColours) object;
189 return target.getColour();
192 public void setValue(java.lang.Object object, java.lang.Object value)
193 throws IllegalStateException, IllegalArgumentException
197 JalviewUserColours target = (JalviewUserColours) object;
198 target.addColour((Colour) value);
199 } catch (java.lang.Exception ex)
201 throw new IllegalStateException(ex.toString());
205 public void resetValue(Object object) throws IllegalStateException,
206 IllegalArgumentException
210 JalviewUserColours target = (JalviewUserColours) object;
211 target.removeAllColour();
212 } catch (java.lang.Exception ex)
214 throw new IllegalStateException(ex.toString());
218 public java.lang.Object newInstance(java.lang.Object parent)
223 desc.setHandler(handler);
224 desc.setMultivalued(true);
225 addFieldDescriptor(desc);
227 // -- validation code for: _colourList
228 fieldValidator = new org.exolab.castor.xml.FieldValidator();
229 fieldValidator.setMinOccurs(0);
232 desc.setValidator(fieldValidator);
240 * Method getAccessMode.
242 * @return the access mode specified for this class.
244 public org.exolab.castor.mapping.AccessMode getAccessMode()
250 * Method getIdentity.
252 * @return the identity field, null if this class has no identity.
254 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
256 return super.getIdentity();
260 * Method getJavaClass.
262 * @return the Java class represented by this descriptor.
264 public java.lang.Class getJavaClass()
266 return jalview.schemabinding.version2.JalviewUserColours.class;
270 * Method getNameSpacePrefix.
272 * @return the namespace prefix to use when marshaling as XML.
274 public java.lang.String getNameSpacePrefix()
280 * Method getNameSpaceURI.
282 * @return the namespace URI used when marshaling and unmarshaling as XML.
284 public java.lang.String getNameSpaceURI()
290 * Method getValidator.
292 * @return a specific validator for the class described by this
295 public org.exolab.castor.xml.TypeValidator getValidator()
303 * @return the XML Name for the Class being described.
305 public java.lang.String getXMLName()
311 * Method isElementDefinition.
313 * @return true if XML schema definition of this Class is that of a global
314 * element or element with anonymous type definition.
316 public boolean isElementDefinition()
318 return _elementDefinition;