1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1)
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.UserColours;
36 * Class UserColoursDescriptor.
38 * @version $Revision$ $Date$
40 public class UserColoursDescriptor extends
41 org.exolab.castor.xml.util.XMLClassDescriptorImpl
44 // --------------------------/
45 // - Class/Member Variables -/
46 // --------------------------/
49 * Field _elementDefinition.
51 private boolean _elementDefinition;
56 private java.lang.String _nsPrefix;
61 private java.lang.String _nsURI;
66 private java.lang.String _xmlName;
72 public UserColoursDescriptor()
75 _nsURI = "www.jalview.org";
76 _xmlName = "UserColours";
77 _elementDefinition = true;
79 // -- set grouping compositor
80 setCompositorAsSequence();
81 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
82 org.exolab.castor.mapping.FieldHandler handler = null;
83 org.exolab.castor.xml.FieldValidator fieldValidator = null;
84 // -- initialize attribute descriptors
87 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
88 java.lang.String.class, "_id", "id",
89 org.exolab.castor.xml.NodeType.Attribute);
90 desc.setImmutable(true);
91 handler = new org.exolab.castor.xml.XMLFieldHandler()
93 public java.lang.Object getValue(java.lang.Object object)
94 throws IllegalStateException
96 UserColours target = (UserColours) object;
97 return target.getId();
100 public void setValue(java.lang.Object object, java.lang.Object value)
101 throws IllegalStateException, IllegalArgumentException
105 UserColours target = (UserColours) object;
106 target.setId((java.lang.String) value);
107 } catch (java.lang.Exception ex)
109 throw new IllegalStateException(ex.toString());
113 public java.lang.Object newInstance(java.lang.Object parent)
118 desc.setHandler(handler);
119 desc.setMultivalued(false);
120 addFieldDescriptor(desc);
122 // -- validation code for: _id
123 fieldValidator = new org.exolab.castor.xml.FieldValidator();
125 org.exolab.castor.xml.validators.StringValidator typeValidator;
126 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
127 fieldValidator.setValidator(typeValidator);
128 typeValidator.setWhiteSpace("preserve");
130 desc.setValidator(fieldValidator);
131 // -- initialize element descriptors
133 // -- _userColourScheme
134 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
135 jalview.schemabinding.version2.UserColourScheme.class,
136 "_userColourScheme", "UserColourScheme",
137 org.exolab.castor.xml.NodeType.Element);
138 handler = new org.exolab.castor.xml.XMLFieldHandler()
140 public java.lang.Object getValue(java.lang.Object object)
141 throws IllegalStateException
143 UserColours target = (UserColours) object;
144 return target.getUserColourScheme();
147 public void setValue(java.lang.Object object, java.lang.Object value)
148 throws IllegalStateException, IllegalArgumentException
152 UserColours target = (UserColours) object;
153 target.setUserColourScheme((jalview.schemabinding.version2.UserColourScheme) value);
154 } catch (java.lang.Exception ex)
156 throw new IllegalStateException(ex.toString());
160 public java.lang.Object newInstance(java.lang.Object parent)
162 return new jalview.schemabinding.version2.UserColourScheme();
165 desc.setHandler(handler);
166 desc.setNameSpaceURI("www.jalview.org");
167 desc.setRequired(true);
168 desc.setMultivalued(false);
169 addFieldDescriptor(desc);
171 // -- validation code for: _userColourScheme
172 fieldValidator = new org.exolab.castor.xml.FieldValidator();
173 fieldValidator.setMinOccurs(1);
176 desc.setValidator(fieldValidator);
184 * Method getAccessMode.
186 * @return the access mode specified for this class.
188 public org.exolab.castor.mapping.AccessMode getAccessMode()
194 * Method getIdentity.
196 * @return the identity field, null if this class has no identity.
198 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
200 return super.getIdentity();
204 * Method getJavaClass.
206 * @return the Java class represented by this descriptor.
208 public java.lang.Class getJavaClass()
210 return jalview.schemabinding.version2.UserColours.class;
214 * Method getNameSpacePrefix.
216 * @return the namespace prefix to use when marshaling as XML.
218 public java.lang.String getNameSpacePrefix()
224 * Method getNameSpaceURI.
226 * @return the namespace URI used when marshaling and unmarshaling as XML.
228 public java.lang.String getNameSpaceURI()
234 * Method getValidator.
236 * @return a specific validator for the class described by this
239 public org.exolab.castor.xml.TypeValidator getValidator()
247 * @return the XML Name for the Class being described.
249 public java.lang.String getXMLName()
255 * Method isElementDefinition.
257 * @return true if XML schema definition of this Class is that of a global
258 * element or element with anonymous type definition.
260 public boolean isElementDefinition()
262 return _elementDefinition;