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.CompoundMatcher;
17 * Class CompoundMatcherDescriptor.
19 * @version $Revision$ $Date$
21 public class CompoundMatcherDescriptor
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 CompoundMatcherDescriptor()
56 _xmlName = "compoundMatcher";
57 _elementDefinition = true;
59 // -- set grouping compositor
60 setCompositorAsSequence();
61 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
62 org.exolab.castor.mapping.FieldHandler handler = null;
63 org.exolab.castor.xml.FieldValidator fieldValidator = null;
64 // -- initialize attribute descriptors
67 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
68 java.lang.Boolean.TYPE, "_and", "and",
69 org.exolab.castor.xml.NodeType.Attribute);
70 handler = new org.exolab.castor.xml.XMLFieldHandler()
72 public java.lang.Object getValue(java.lang.Object object)
73 throws IllegalStateException
75 CompoundMatcher target = (CompoundMatcher) object;
80 return (target.getAnd() ? java.lang.Boolean.TRUE
81 : java.lang.Boolean.FALSE);
84 public void setValue(java.lang.Object object, java.lang.Object value)
85 throws IllegalStateException, IllegalArgumentException
89 CompoundMatcher target = (CompoundMatcher) object;
90 // ignore null values for non optional primitives
96 target.setAnd(((java.lang.Boolean) value).booleanValue());
97 } catch (java.lang.Exception ex)
99 throw new IllegalStateException(ex.toString());
103 public java.lang.Object newInstance(java.lang.Object parent)
108 desc.setHandler(handler);
109 desc.setRequired(true);
110 desc.setMultivalued(false);
111 addFieldDescriptor(desc);
113 // -- validation code for: _and
114 fieldValidator = new org.exolab.castor.xml.FieldValidator();
115 fieldValidator.setMinOccurs(1);
117 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
118 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
119 fieldValidator.setValidator(typeValidator);
121 desc.setValidator(fieldValidator);
122 // -- initialize element descriptors
124 // -- _matcherSetList
125 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
126 jalview.schemabinding.version2.MatcherSet.class,
127 "_matcherSetList", "matcherSet",
128 org.exolab.castor.xml.NodeType.Element);
129 handler = new org.exolab.castor.xml.XMLFieldHandler()
131 public java.lang.Object getValue(java.lang.Object object)
132 throws IllegalStateException
134 CompoundMatcher target = (CompoundMatcher) object;
135 return target.getMatcherSet();
138 public void setValue(java.lang.Object object, java.lang.Object value)
139 throws IllegalStateException, IllegalArgumentException
143 CompoundMatcher target = (CompoundMatcher) object;
144 target.addMatcherSet(
145 (jalview.schemabinding.version2.MatcherSet) value);
146 } catch (java.lang.Exception ex)
148 throw new IllegalStateException(ex.toString());
152 public void resetValue(Object object)
153 throws IllegalStateException, IllegalArgumentException
157 CompoundMatcher target = (CompoundMatcher) object;
158 target.removeAllMatcherSet();
159 } catch (java.lang.Exception ex)
161 throw new IllegalStateException(ex.toString());
165 public java.lang.Object newInstance(java.lang.Object parent)
167 return new jalview.schemabinding.version2.MatcherSet();
170 desc.setHandler(handler);
171 desc.setRequired(true);
172 desc.setMultivalued(true);
173 addFieldDescriptor(desc);
175 // -- validation code for: _matcherSetList
176 fieldValidator = new org.exolab.castor.xml.FieldValidator();
177 fieldValidator.setMinOccurs(2);
178 fieldValidator.setMaxOccurs(2);
181 desc.setValidator(fieldValidator);
189 * Method getAccessMode.
191 * @return the access mode specified for this class.
193 public org.exolab.castor.mapping.AccessMode getAccessMode()
199 * Method getIdentity.
201 * @return the identity field, null if this class has no identity.
203 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
205 return super.getIdentity();
209 * Method getJavaClass.
211 * @return the Java class represented by this descriptor.
213 public java.lang.Class getJavaClass()
215 return jalview.schemabinding.version2.CompoundMatcher.class;
219 * Method getNameSpacePrefix.
221 * @return the namespace prefix to use when marshaling as XML.
223 public java.lang.String getNameSpacePrefix()
229 * Method getNameSpaceURI.
231 * @return the namespace URI used when marshaling and unmarshaling as XML.
233 public java.lang.String getNameSpaceURI()
239 * Method getValidator.
241 * @return a specific validator for the class described by this
244 public org.exolab.castor.xml.TypeValidator getValidator()
252 * @return the XML Name for the Class being described.
254 public java.lang.String getXMLName()
260 * Method isElementDefinition.
262 * @return true if XML schema definition of this Class is that of a global
263 * element or element with anonymous type definition.
265 public boolean isElementDefinition()
267 return _elementDefinition;