JAL-2843 schema and code changes to save colour by attribute and filters in user...
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / CompoundMatcherDescriptor.java
1 /*
2  * This class was automatically generated with 
3  * <a href="http://www.castor.org">Castor 1.1</a>, using an XML
4  * Schema.
5  * $Id$
6  */
7
8 package jalview.schemabinding.version2.descriptors;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import jalview.schemabinding.version2.CompoundMatcher;
15
16 /**
17  * Class CompoundMatcherDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class CompoundMatcherDescriptor
22         extends org.exolab.castor.xml.util.XMLClassDescriptorImpl
23 {
24
25   // --------------------------/
26   // - Class/Member Variables -/
27   // --------------------------/
28
29   /**
30    * Field _elementDefinition.
31    */
32   private boolean _elementDefinition;
33
34   /**
35    * Field _nsPrefix.
36    */
37   private java.lang.String _nsPrefix;
38
39   /**
40    * Field _nsURI.
41    */
42   private java.lang.String _nsURI;
43
44   /**
45    * Field _xmlName.
46    */
47   private java.lang.String _xmlName;
48
49   // ----------------/
50   // - Constructors -/
51   // ----------------/
52
53   public CompoundMatcherDescriptor()
54   {
55     super();
56     _xmlName = "compoundMatcher";
57     _elementDefinition = true;
58
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
65
66     // -- _and
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()
71     {
72       public java.lang.Object getValue(java.lang.Object object)
73               throws IllegalStateException
74       {
75         CompoundMatcher target = (CompoundMatcher) object;
76         if (!target.hasAnd())
77         {
78           return null;
79         }
80         return (target.getAnd() ? java.lang.Boolean.TRUE
81                 : java.lang.Boolean.FALSE);
82       }
83
84       public void setValue(java.lang.Object object, java.lang.Object value)
85               throws IllegalStateException, IllegalArgumentException
86       {
87         try
88         {
89           CompoundMatcher target = (CompoundMatcher) object;
90           // ignore null values for non optional primitives
91           if (value == null)
92           {
93             return;
94           }
95
96           target.setAnd(((java.lang.Boolean) value).booleanValue());
97         } catch (java.lang.Exception ex)
98         {
99           throw new IllegalStateException(ex.toString());
100         }
101       }
102
103       public java.lang.Object newInstance(java.lang.Object parent)
104       {
105         return null;
106       }
107     };
108     desc.setHandler(handler);
109     desc.setRequired(true);
110     desc.setMultivalued(false);
111     addFieldDescriptor(desc);
112
113     // -- validation code for: _and
114     fieldValidator = new org.exolab.castor.xml.FieldValidator();
115     fieldValidator.setMinOccurs(1);
116     { // -- local scope
117       org.exolab.castor.xml.validators.BooleanValidator typeValidator;
118       typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
119       fieldValidator.setValidator(typeValidator);
120     }
121     desc.setValidator(fieldValidator);
122     // -- initialize element descriptors
123
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()
130     {
131       public java.lang.Object getValue(java.lang.Object object)
132               throws IllegalStateException
133       {
134         CompoundMatcher target = (CompoundMatcher) object;
135         return target.getMatcherSet();
136       }
137
138       public void setValue(java.lang.Object object, java.lang.Object value)
139               throws IllegalStateException, IllegalArgumentException
140       {
141         try
142         {
143           CompoundMatcher target = (CompoundMatcher) object;
144           target.addMatcherSet(
145                   (jalview.schemabinding.version2.MatcherSet) value);
146         } catch (java.lang.Exception ex)
147         {
148           throw new IllegalStateException(ex.toString());
149         }
150       }
151
152       public void resetValue(Object object)
153               throws IllegalStateException, IllegalArgumentException
154       {
155         try
156         {
157           CompoundMatcher target = (CompoundMatcher) object;
158           target.removeAllMatcherSet();
159         } catch (java.lang.Exception ex)
160         {
161           throw new IllegalStateException(ex.toString());
162         }
163       }
164
165       public java.lang.Object newInstance(java.lang.Object parent)
166       {
167         return new jalview.schemabinding.version2.MatcherSet();
168       }
169     };
170     desc.setHandler(handler);
171     desc.setRequired(true);
172     desc.setMultivalued(true);
173     addFieldDescriptor(desc);
174
175     // -- validation code for: _matcherSetList
176     fieldValidator = new org.exolab.castor.xml.FieldValidator();
177     fieldValidator.setMinOccurs(2);
178     fieldValidator.setMaxOccurs(2);
179     { // -- local scope
180     }
181     desc.setValidator(fieldValidator);
182   }
183
184   // -----------/
185   // - Methods -/
186   // -----------/
187
188   /**
189    * Method getAccessMode.
190    * 
191    * @return the access mode specified for this class.
192    */
193   public org.exolab.castor.mapping.AccessMode getAccessMode()
194   {
195     return null;
196   }
197
198   /**
199    * Method getIdentity.
200    * 
201    * @return the identity field, null if this class has no identity.
202    */
203   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
204   {
205     return super.getIdentity();
206   }
207
208   /**
209    * Method getJavaClass.
210    * 
211    * @return the Java class represented by this descriptor.
212    */
213   public java.lang.Class getJavaClass()
214   {
215     return jalview.schemabinding.version2.CompoundMatcher.class;
216   }
217
218   /**
219    * Method getNameSpacePrefix.
220    * 
221    * @return the namespace prefix to use when marshaling as XML.
222    */
223   public java.lang.String getNameSpacePrefix()
224   {
225     return _nsPrefix;
226   }
227
228   /**
229    * Method getNameSpaceURI.
230    * 
231    * @return the namespace URI used when marshaling and unmarshaling as XML.
232    */
233   public java.lang.String getNameSpaceURI()
234   {
235     return _nsURI;
236   }
237
238   /**
239    * Method getValidator.
240    * 
241    * @return a specific validator for the class described by this
242    *         ClassDescriptor.
243    */
244   public org.exolab.castor.xml.TypeValidator getValidator()
245   {
246     return this;
247   }
248
249   /**
250    * Method getXMLName.
251    * 
252    * @return the XML Name for the Class being described.
253    */
254   public java.lang.String getXMLName()
255   {
256     return _xmlName;
257   }
258
259   /**
260    * Method isElementDefinition.
261    * 
262    * @return true if XML schema definition of this Class is that of a global
263    *         element or element with anonymous type definition.
264    */
265   public boolean isElementDefinition()
266   {
267     return _elementDefinition;
268   }
269
270 }