1 /*******************************************************************************
2 * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
3 * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
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. If not, see <http://www.gnu.org/licenses/>.
17 *******************************************************************************/
19 * This class was automatically generated with
20 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
25 package jalview.schemabinding.version2.descriptors;
27 //---------------------------------/
28 //- Imported classes and packages -/
29 //---------------------------------/
31 import jalview.schemabinding.version2.FeatureSettings;
34 * Class FeatureSettingsDescriptor.
36 * @version $Revision$ $Date$
38 public class FeatureSettingsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
41 //--------------------------/
42 //- Class/Member Variables -/
43 //--------------------------/
46 * Field _elementDefinition.
48 private boolean _elementDefinition;
53 private java.lang.String _nsPrefix;
58 private java.lang.String _nsURI;
63 private java.lang.String _xmlName;
70 public FeatureSettingsDescriptor() {
72 _nsURI = "www.jalview.org";
73 _xmlName = "FeatureSettings";
74 _elementDefinition = true;
76 //-- set grouping compositor
77 setCompositorAsSequence();
78 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
79 org.exolab.castor.mapping.FieldHandler handler = null;
80 org.exolab.castor.xml.FieldValidator fieldValidator = null;
81 //-- initialize attribute descriptors
83 //-- initialize element descriptors
86 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Setting.class, "_settingList", "setting", org.exolab.castor.xml.NodeType.Element);
87 handler = new org.exolab.castor.xml.XMLFieldHandler() {
88 public java.lang.Object getValue( java.lang.Object object )
89 throws IllegalStateException
91 FeatureSettings target = (FeatureSettings) object;
92 return target.getSetting();
94 public void setValue( java.lang.Object object, java.lang.Object value)
95 throws IllegalStateException, IllegalArgumentException
98 FeatureSettings target = (FeatureSettings) object;
99 target.addSetting( (jalview.schemabinding.version2.Setting) value);
100 } catch (java.lang.Exception ex) {
101 throw new IllegalStateException(ex.toString());
104 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
106 FeatureSettings target = (FeatureSettings) object;
107 target.removeAllSetting();
108 } catch (java.lang.Exception ex) {
109 throw new IllegalStateException(ex.toString());
112 public java.lang.Object newInstance(java.lang.Object parent) {
113 return new jalview.schemabinding.version2.Setting();
116 desc.setHandler(handler);
117 desc.setNameSpaceURI("www.jalview.org");
118 desc.setMultivalued(true);
119 addFieldDescriptor(desc);
121 //-- validation code for: _settingList
122 fieldValidator = new org.exolab.castor.xml.FieldValidator();
123 fieldValidator.setMinOccurs(0);
126 desc.setValidator(fieldValidator);
128 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Group.class, "_groupList", "group", org.exolab.castor.xml.NodeType.Element);
129 handler = new org.exolab.castor.xml.XMLFieldHandler() {
130 public java.lang.Object getValue( java.lang.Object object )
131 throws IllegalStateException
133 FeatureSettings target = (FeatureSettings) object;
134 return target.getGroup();
136 public void setValue( java.lang.Object object, java.lang.Object value)
137 throws IllegalStateException, IllegalArgumentException
140 FeatureSettings target = (FeatureSettings) object;
141 target.addGroup( (jalview.schemabinding.version2.Group) value);
142 } catch (java.lang.Exception ex) {
143 throw new IllegalStateException(ex.toString());
146 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
148 FeatureSettings target = (FeatureSettings) object;
149 target.removeAllGroup();
150 } catch (java.lang.Exception ex) {
151 throw new IllegalStateException(ex.toString());
154 public java.lang.Object newInstance(java.lang.Object parent) {
155 return new jalview.schemabinding.version2.Group();
158 desc.setHandler(handler);
159 desc.setNameSpaceURI("www.jalview.org");
160 desc.setMultivalued(true);
161 addFieldDescriptor(desc);
163 //-- validation code for: _groupList
164 fieldValidator = new org.exolab.castor.xml.FieldValidator();
165 fieldValidator.setMinOccurs(0);
168 desc.setValidator(fieldValidator);
177 * Method getAccessMode.
179 * @return the access mode specified for this class.
181 public org.exolab.castor.mapping.AccessMode getAccessMode(
187 * Method getIdentity.
189 * @return the identity field, null if this class has no
192 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
194 return super.getIdentity();
198 * Method getJavaClass.
200 * @return the Java class represented by this descriptor.
202 public java.lang.Class getJavaClass(
204 return jalview.schemabinding.version2.FeatureSettings.class;
208 * Method getNameSpacePrefix.
210 * @return the namespace prefix to use when marshaling as XML.
212 public java.lang.String getNameSpacePrefix(
218 * Method getNameSpaceURI.
220 * @return the namespace URI used when marshaling and
221 * unmarshaling as XML.
223 public java.lang.String getNameSpaceURI(
229 * Method getValidator.
231 * @return a specific validator for the class described by this
234 public org.exolab.castor.xml.TypeValidator getValidator(
242 * @return the XML Name for the Class being described.
244 public java.lang.String getXMLName(
250 * Method isElementDefinition.
252 * @return true if XML schema definition of this Class is that
254 * element or element with anonymous type definition.
256 public boolean isElementDefinition(
258 return _elementDefinition;