2 * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
\r
3 * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.schemabinding.version2.descriptors;
\r
21 //---------------------------------/
\r
22 //- Imported classes and packages -/
\r
23 //---------------------------------/
\r
25 import jalview.schemabinding.version2.FeatureSettings;
\r
28 * Class FeatureSettingsDescriptor.
\r
30 * @version $Revision$ $Date$
\r
32 public class FeatureSettingsDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
\r
35 //--------------------------/
\r
36 //- Class/Member Variables -/
\r
37 //--------------------------/
\r
40 * Field _elementDefinition.
\r
42 private boolean _elementDefinition;
\r
47 private java.lang.String _nsPrefix;
\r
52 private java.lang.String _nsURI;
\r
57 private java.lang.String _xmlName;
\r
64 public FeatureSettingsDescriptor() {
\r
66 _nsURI = "www.jalview.org";
\r
67 _xmlName = "FeatureSettings";
\r
68 _elementDefinition = true;
\r
70 //-- set grouping compositor
\r
71 setCompositorAsSequence();
\r
72 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
\r
73 org.exolab.castor.mapping.FieldHandler handler = null;
\r
74 org.exolab.castor.xml.FieldValidator fieldValidator = null;
\r
75 //-- initialize attribute descriptors
\r
77 //-- initialize element descriptors
\r
80 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Setting.class, "_settingList", "setting", org.exolab.castor.xml.NodeType.Element);
\r
81 handler = new org.exolab.castor.xml.XMLFieldHandler() {
\r
82 public java.lang.Object getValue( java.lang.Object object )
\r
83 throws IllegalStateException
\r
85 FeatureSettings target = (FeatureSettings) object;
\r
86 return target.getSetting();
\r
88 public void setValue( java.lang.Object object, java.lang.Object value)
\r
89 throws IllegalStateException, IllegalArgumentException
\r
92 FeatureSettings target = (FeatureSettings) object;
\r
93 target.addSetting( (jalview.schemabinding.version2.Setting) value);
\r
94 } catch (java.lang.Exception ex) {
\r
95 throw new IllegalStateException(ex.toString());
\r
98 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
\r
100 FeatureSettings target = (FeatureSettings) object;
\r
101 target.removeAllSetting();
\r
102 } catch (java.lang.Exception ex) {
\r
103 throw new IllegalStateException(ex.toString());
\r
106 public java.lang.Object newInstance(java.lang.Object parent) {
\r
107 return new jalview.schemabinding.version2.Setting();
\r
110 desc.setHandler(handler);
\r
111 desc.setNameSpaceURI("www.jalview.org");
\r
112 desc.setMultivalued(true);
\r
113 addFieldDescriptor(desc);
\r
115 //-- validation code for: _settingList
\r
116 fieldValidator = new org.exolab.castor.xml.FieldValidator();
\r
117 fieldValidator.setMinOccurs(0);
\r
120 desc.setValidator(fieldValidator);
\r
122 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(jalview.schemabinding.version2.Group.class, "_groupList", "group", org.exolab.castor.xml.NodeType.Element);
\r
123 handler = new org.exolab.castor.xml.XMLFieldHandler() {
\r
124 public java.lang.Object getValue( java.lang.Object object )
\r
125 throws IllegalStateException
\r
127 FeatureSettings target = (FeatureSettings) object;
\r
128 return target.getGroup();
\r
130 public void setValue( java.lang.Object object, java.lang.Object value)
\r
131 throws IllegalStateException, IllegalArgumentException
\r
134 FeatureSettings target = (FeatureSettings) object;
\r
135 target.addGroup( (jalview.schemabinding.version2.Group) value);
\r
136 } catch (java.lang.Exception ex) {
\r
137 throw new IllegalStateException(ex.toString());
\r
140 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
\r
142 FeatureSettings target = (FeatureSettings) object;
\r
143 target.removeAllGroup();
\r
144 } catch (java.lang.Exception ex) {
\r
145 throw new IllegalStateException(ex.toString());
\r
148 public java.lang.Object newInstance(java.lang.Object parent) {
\r
149 return new jalview.schemabinding.version2.Group();
\r
152 desc.setHandler(handler);
\r
153 desc.setNameSpaceURI("www.jalview.org");
\r
154 desc.setMultivalued(true);
\r
155 addFieldDescriptor(desc);
\r
157 //-- validation code for: _groupList
\r
158 fieldValidator = new org.exolab.castor.xml.FieldValidator();
\r
159 fieldValidator.setMinOccurs(0);
\r
162 desc.setValidator(fieldValidator);
\r
171 * Method getAccessMode.
\r
173 * @return the access mode specified for this class.
\r
175 public org.exolab.castor.mapping.AccessMode getAccessMode(
\r
181 * Method getIdentity.
\r
183 * @return the identity field, null if this class has no
\r
186 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
\r
188 return super.getIdentity();
\r
192 * Method getJavaClass.
\r
194 * @return the Java class represented by this descriptor.
\r
196 public java.lang.Class getJavaClass(
\r
198 return jalview.schemabinding.version2.FeatureSettings.class;
\r
202 * Method getNameSpacePrefix.
\r
204 * @return the namespace prefix to use when marshaling as XML.
\r
206 public java.lang.String getNameSpacePrefix(
\r
212 * Method getNameSpaceURI.
\r
214 * @return the namespace URI used when marshaling and
\r
215 * unmarshaling as XML.
\r
217 public java.lang.String getNameSpaceURI(
\r
223 * Method getValidator.
\r
225 * @return a specific validator for the class described by this
\r
228 public org.exolab.castor.xml.TypeValidator getValidator(
\r
234 * Method getXMLName.
\r
236 * @return the XML Name for the Class being described.
\r
238 public java.lang.String getXMLName(
\r
244 * Method isElementDefinition.
\r
246 * @return true if XML schema definition of this Class is that
\r
248 * element or element with anonymous type definition.
\r
250 public boolean isElementDefinition(
\r
252 return _elementDefinition;
\r