JAL-3120 preserve feature colour/mincolour/maxcolour while modifying,
[jalview.git] / src / jalview / schemabinding / version2 / descriptors / FeatureMatcherDescriptor.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.FeatureMatcher;
15
16 /**
17  * Class FeatureMatcherDescriptor.
18  * 
19  * @version $Revision$ $Date$
20  */
21 public class FeatureMatcherDescriptor
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 FeatureMatcherDescriptor()
54   {
55     super();
56     _nsURI = "www.jalview.org/colours";
57     _xmlName = "FeatureMatcher";
58     _elementDefinition = false;
59
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
66
67     // -- _by
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()
72     {
73       public java.lang.Object getValue(java.lang.Object object)
74               throws IllegalStateException
75       {
76         FeatureMatcher target = (FeatureMatcher) object;
77         return target.getBy();
78       }
79
80       public void setValue(java.lang.Object object, java.lang.Object value)
81               throws IllegalStateException, IllegalArgumentException
82       {
83         try
84         {
85           FeatureMatcher target = (FeatureMatcher) object;
86           target.setBy(
87                   (jalview.schemabinding.version2.types.FeatureMatcherByType) value);
88         } catch (java.lang.Exception ex)
89         {
90           throw new IllegalStateException(ex.toString());
91         }
92       }
93
94       public java.lang.Object newInstance(java.lang.Object parent)
95       {
96         return null;
97       }
98     };
99     handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(
100             jalview.schemabinding.version2.types.FeatureMatcherByType.class,
101             handler);
102     desc.setImmutable(true);
103     desc.setHandler(handler);
104     desc.setMultivalued(false);
105     addFieldDescriptor(desc);
106
107     // -- validation code for: _by
108     fieldValidator = new org.exolab.castor.xml.FieldValidator();
109     { // -- local scope
110     }
111     desc.setValidator(fieldValidator);
112     // -- initialize element descriptors
113
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()
120     {
121       public java.lang.Object getValue(java.lang.Object object)
122               throws IllegalStateException
123       {
124         FeatureMatcher target = (FeatureMatcher) object;
125         return target.getAttributeName();
126       }
127
128       public void setValue(java.lang.Object object, java.lang.Object value)
129               throws IllegalStateException, IllegalArgumentException
130       {
131         try
132         {
133           FeatureMatcher target = (FeatureMatcher) object;
134           target.addAttributeName((java.lang.String) value);
135         } catch (java.lang.Exception ex)
136         {
137           throw new IllegalStateException(ex.toString());
138         }
139       }
140
141       public void resetValue(Object object)
142               throws IllegalStateException, IllegalArgumentException
143       {
144         try
145         {
146           FeatureMatcher target = (FeatureMatcher) object;
147           target.removeAllAttributeName();
148         } catch (java.lang.Exception ex)
149         {
150           throw new IllegalStateException(ex.toString());
151         }
152       }
153
154       public java.lang.Object newInstance(java.lang.Object parent)
155       {
156         return null;
157       }
158     };
159     desc.setHandler(handler);
160     desc.setMultivalued(true);
161     addFieldDescriptor(desc);
162
163     // -- validation code for: _attributeNameList
164     fieldValidator = new org.exolab.castor.xml.FieldValidator();
165     fieldValidator.setMinOccurs(0);
166     fieldValidator.setMaxOccurs(2);
167     { // -- local scope
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");
172     }
173     desc.setValidator(fieldValidator);
174     // -- _condition
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()
180     {
181       public java.lang.Object getValue(java.lang.Object object)
182               throws IllegalStateException
183       {
184         FeatureMatcher target = (FeatureMatcher) object;
185         return target.getCondition();
186       }
187
188       public void setValue(java.lang.Object object, java.lang.Object value)
189               throws IllegalStateException, IllegalArgumentException
190       {
191         try
192         {
193           FeatureMatcher target = (FeatureMatcher) object;
194           target.setCondition((java.lang.String) value);
195         } catch (java.lang.Exception ex)
196         {
197           throw new IllegalStateException(ex.toString());
198         }
199       }
200
201       public java.lang.Object newInstance(java.lang.Object parent)
202       {
203         return null;
204       }
205     };
206     desc.setHandler(handler);
207     desc.setRequired(true);
208     desc.setMultivalued(false);
209     addFieldDescriptor(desc);
210
211     // -- validation code for: _condition
212     fieldValidator = new org.exolab.castor.xml.FieldValidator();
213     fieldValidator.setMinOccurs(1);
214     { // -- local scope
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");
219     }
220     desc.setValidator(fieldValidator);
221     // -- _value
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()
227     {
228       public java.lang.Object getValue(java.lang.Object object)
229               throws IllegalStateException
230       {
231         FeatureMatcher target = (FeatureMatcher) object;
232         return target.getValue();
233       }
234
235       public void setValue(java.lang.Object object, java.lang.Object value)
236               throws IllegalStateException, IllegalArgumentException
237       {
238         try
239         {
240           FeatureMatcher target = (FeatureMatcher) object;
241           target.setValue((java.lang.String) value);
242         } catch (java.lang.Exception ex)
243         {
244           throw new IllegalStateException(ex.toString());
245         }
246       }
247
248       public java.lang.Object newInstance(java.lang.Object parent)
249       {
250         return null;
251       }
252     };
253     desc.setHandler(handler);
254     desc.setRequired(true);
255     desc.setMultivalued(false);
256     addFieldDescriptor(desc);
257
258     // -- validation code for: _value
259     fieldValidator = new org.exolab.castor.xml.FieldValidator();
260     fieldValidator.setMinOccurs(1);
261     { // -- local scope
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");
266     }
267     desc.setValidator(fieldValidator);
268   }
269
270   // -----------/
271   // - Methods -/
272   // -----------/
273
274   /**
275    * Method getAccessMode.
276    * 
277    * @return the access mode specified for this class.
278    */
279   public org.exolab.castor.mapping.AccessMode getAccessMode()
280   {
281     return null;
282   }
283
284   /**
285    * Method getIdentity.
286    * 
287    * @return the identity field, null if this class has no identity.
288    */
289   public org.exolab.castor.mapping.FieldDescriptor getIdentity()
290   {
291     return super.getIdentity();
292   }
293
294   /**
295    * Method getJavaClass.
296    * 
297    * @return the Java class represented by this descriptor.
298    */
299   public java.lang.Class getJavaClass()
300   {
301     return jalview.schemabinding.version2.FeatureMatcher.class;
302   }
303
304   /**
305    * Method getNameSpacePrefix.
306    * 
307    * @return the namespace prefix to use when marshaling as XML.
308    */
309   public java.lang.String getNameSpacePrefix()
310   {
311     return _nsPrefix;
312   }
313
314   /**
315    * Method getNameSpaceURI.
316    * 
317    * @return the namespace URI used when marshaling and unmarshaling as XML.
318    */
319   public java.lang.String getNameSpaceURI()
320   {
321     return _nsURI;
322   }
323
324   /**
325    * Method getValidator.
326    * 
327    * @return a specific validator for the class described by this
328    *         ClassDescriptor.
329    */
330   public org.exolab.castor.xml.TypeValidator getValidator()
331   {
332     return this;
333   }
334
335   /**
336    * Method getXMLName.
337    * 
338    * @return the XML Name for the Class being described.
339    */
340   public java.lang.String getXMLName()
341   {
342     return _xmlName;
343   }
344
345   /**
346    * Method isElementDefinition.
347    * 
348    * @return true if XML schema definition of this Class is that of a global
349    *         element or element with anonymous type definition.
350    */
351   public boolean isElementDefinition()
352   {
353     return _elementDefinition;
354   }
355
356 }