2 * This class was automatically generated with
3 * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
8 package jalview.schemabinding.version2.descriptors;
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
14 import jalview.schemabinding.version2.FeatureMatcher;
17 * Class FeatureMatcherDescriptor.
19 * @version $Revision$ $Date$
21 public class FeatureMatcherDescriptor
22 extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
25 // --------------------------/
26 // - Class/Member Variables -/
27 // --------------------------/
30 * Field _elementDefinition.
32 private boolean _elementDefinition;
37 private java.lang.String _nsPrefix;
42 private java.lang.String _nsURI;
47 private java.lang.String _xmlName;
53 public FeatureMatcherDescriptor()
56 _nsURI = "www.jalview.org/colours";
57 _xmlName = "FeatureMatcher";
58 _elementDefinition = false;
60 // -- set grouping compositor
61 setCompositorAsSequence();
62 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
63 org.exolab.castor.mapping.FieldHandler handler = null;
64 org.exolab.castor.xml.FieldValidator fieldValidator = null;
65 // -- initialize attribute descriptors
68 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
69 jalview.schemabinding.version2.types.FeatureMatcherByType.class,
70 "_by", "by", org.exolab.castor.xml.NodeType.Attribute);
71 handler = new org.exolab.castor.xml.XMLFieldHandler()
73 public java.lang.Object getValue(java.lang.Object object)
74 throws IllegalStateException
76 FeatureMatcher target = (FeatureMatcher) object;
77 return target.getBy();
80 public void setValue(java.lang.Object object, java.lang.Object value)
81 throws IllegalStateException, IllegalArgumentException
85 FeatureMatcher target = (FeatureMatcher) object;
87 (jalview.schemabinding.version2.types.FeatureMatcherByType) value);
88 } catch (java.lang.Exception ex)
90 throw new IllegalStateException(ex.toString());
94 public java.lang.Object newInstance(java.lang.Object parent)
99 handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
100 jalview.schemabinding.version2.types.FeatureMatcherByType.class,
102 desc.setImmutable(true);
103 desc.setHandler(handler);
104 desc.setMultivalued(false);
105 addFieldDescriptor(desc);
107 // -- validation code for: _by
108 fieldValidator = new org.exolab.castor.xml.FieldValidator();
111 desc.setValidator(fieldValidator);
112 // -- initialize element descriptors
114 // -- _attributeNameList
115 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
116 java.lang.String.class, "_attributeNameList", "attributeName",
117 org.exolab.castor.xml.NodeType.Element);
118 desc.setImmutable(true);
119 handler = new org.exolab.castor.xml.XMLFieldHandler()
121 public java.lang.Object getValue(java.lang.Object object)
122 throws IllegalStateException
124 FeatureMatcher target = (FeatureMatcher) object;
125 return target.getAttributeName();
128 public void setValue(java.lang.Object object, java.lang.Object value)
129 throws IllegalStateException, IllegalArgumentException
133 FeatureMatcher target = (FeatureMatcher) object;
134 target.addAttributeName((java.lang.String) value);
135 } catch (java.lang.Exception ex)
137 throw new IllegalStateException(ex.toString());
141 public void resetValue(Object object)
142 throws IllegalStateException, IllegalArgumentException
146 FeatureMatcher target = (FeatureMatcher) object;
147 target.removeAllAttributeName();
148 } catch (java.lang.Exception ex)
150 throw new IllegalStateException(ex.toString());
154 public java.lang.Object newInstance(java.lang.Object parent)
159 desc.setHandler(handler);
160 desc.setMultivalued(true);
161 addFieldDescriptor(desc);
163 // -- validation code for: _attributeNameList
164 fieldValidator = new org.exolab.castor.xml.FieldValidator();
165 fieldValidator.setMinOccurs(0);
166 fieldValidator.setMaxOccurs(2);
168 org.exolab.castor.xml.validators.StringValidator typeValidator;
169 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
170 fieldValidator.setValidator(typeValidator);
171 typeValidator.setWhiteSpace("preserve");
173 desc.setValidator(fieldValidator);
175 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
176 java.lang.String.class, "_condition", "condition",
177 org.exolab.castor.xml.NodeType.Element);
178 desc.setImmutable(true);
179 handler = new org.exolab.castor.xml.XMLFieldHandler()
181 public java.lang.Object getValue(java.lang.Object object)
182 throws IllegalStateException
184 FeatureMatcher target = (FeatureMatcher) object;
185 return target.getCondition();
188 public void setValue(java.lang.Object object, java.lang.Object value)
189 throws IllegalStateException, IllegalArgumentException
193 FeatureMatcher target = (FeatureMatcher) object;
194 target.setCondition((java.lang.String) value);
195 } catch (java.lang.Exception ex)
197 throw new IllegalStateException(ex.toString());
201 public java.lang.Object newInstance(java.lang.Object parent)
206 desc.setHandler(handler);
207 desc.setRequired(true);
208 desc.setMultivalued(false);
209 addFieldDescriptor(desc);
211 // -- validation code for: _condition
212 fieldValidator = new org.exolab.castor.xml.FieldValidator();
213 fieldValidator.setMinOccurs(1);
215 org.exolab.castor.xml.validators.StringValidator typeValidator;
216 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
217 fieldValidator.setValidator(typeValidator);
218 typeValidator.setWhiteSpace("preserve");
220 desc.setValidator(fieldValidator);
222 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
223 java.lang.String.class, "_value", "value",
224 org.exolab.castor.xml.NodeType.Element);
225 desc.setImmutable(true);
226 handler = new org.exolab.castor.xml.XMLFieldHandler()
228 public java.lang.Object getValue(java.lang.Object object)
229 throws IllegalStateException
231 FeatureMatcher target = (FeatureMatcher) object;
232 return target.getValue();
235 public void setValue(java.lang.Object object, java.lang.Object value)
236 throws IllegalStateException, IllegalArgumentException
240 FeatureMatcher target = (FeatureMatcher) object;
241 target.setValue((java.lang.String) value);
242 } catch (java.lang.Exception ex)
244 throw new IllegalStateException(ex.toString());
248 public java.lang.Object newInstance(java.lang.Object parent)
253 desc.setHandler(handler);
254 desc.setRequired(true);
255 desc.setMultivalued(false);
256 addFieldDescriptor(desc);
258 // -- validation code for: _value
259 fieldValidator = new org.exolab.castor.xml.FieldValidator();
260 fieldValidator.setMinOccurs(1);
262 org.exolab.castor.xml.validators.StringValidator typeValidator;
263 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
264 fieldValidator.setValidator(typeValidator);
265 typeValidator.setWhiteSpace("preserve");
267 desc.setValidator(fieldValidator);
275 * Method getAccessMode.
277 * @return the access mode specified for this class.
279 public org.exolab.castor.mapping.AccessMode getAccessMode()
285 * Method getIdentity.
287 * @return the identity field, null if this class has no identity.
289 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
291 return super.getIdentity();
295 * Method getJavaClass.
297 * @return the Java class represented by this descriptor.
299 public java.lang.Class getJavaClass()
301 return jalview.schemabinding.version2.FeatureMatcher.class;
305 * Method getNameSpacePrefix.
307 * @return the namespace prefix to use when marshaling as XML.
309 public java.lang.String getNameSpacePrefix()
315 * Method getNameSpaceURI.
317 * @return the namespace URI used when marshaling and unmarshaling as XML.
319 public java.lang.String getNameSpaceURI()
325 * Method getValidator.
327 * @return a specific validator for the class described by this
330 public org.exolab.castor.xml.TypeValidator getValidator()
338 * @return the XML Name for the Class being described.
340 public java.lang.String getXMLName()
346 * Method isElementDefinition.
348 * @return true if XML schema definition of this Class is that of a global
349 * element or element with anonymous type definition.
351 public boolean isElementDefinition()
353 return _elementDefinition;