Clover icon

jalviewX

  1. Project Clover database Wed Oct 31 2018 15:13:58 GMT
  2. Package jalview.schemabinding.version2.descriptors

File CompoundMatcherDescriptor.java

 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
19% of files have more coverage

Code metrics

6
59
16
1
270
153
22
0.37
3.69
16
1.38

Classes

Class Line # Actions
CompoundMatcherDescriptor 21 59 22 17
0.7901234679%
 

Contributing tests

This file is covered by 2 tests. .

Source view

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  14 toggle public CompoundMatcherDescriptor()
54    {
55  14 super();
56  14 _xmlName = "compoundMatcher";
57  14 _elementDefinition = true;
58   
59    // -- set grouping compositor
60  14 setCompositorAsSequence();
61  14 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
62  14 org.exolab.castor.mapping.FieldHandler handler = null;
63  14 org.exolab.castor.xml.FieldValidator fieldValidator = null;
64    // -- initialize attribute descriptors
65   
66    // -- _and
67  14 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(
68    java.lang.Boolean.TYPE, "_and", "and",
69    org.exolab.castor.xml.NodeType.Attribute);
70  14 handler = new org.exolab.castor.xml.XMLFieldHandler()
71    {
 
72  10 toggle public java.lang.Object getValue(java.lang.Object object)
73    throws IllegalStateException
74    {
75  10 CompoundMatcher target = (CompoundMatcher) object;
76  10 if (!target.hasAnd())
77    {
78  0 return null;
79    }
80  10 return (target.getAnd() ? java.lang.Boolean.TRUE
81    : java.lang.Boolean.FALSE);
82    }
83   
 
84  4 toggle public void setValue(java.lang.Object object, java.lang.Object value)
85    throws IllegalStateException, IllegalArgumentException
86    {
87  4 try
88    {
89  4 CompoundMatcher target = (CompoundMatcher) object;
90    // ignore null values for non optional primitives
91  4 if (value == null)
92    {
93  0 return;
94    }
95   
96  4 target.setAnd(((java.lang.Boolean) value).booleanValue());
97    } catch (java.lang.Exception ex)
98    {
99  0 throw new IllegalStateException(ex.toString());
100    }
101    }
102   
 
103  0 toggle public java.lang.Object newInstance(java.lang.Object parent)
104    {
105  0 return null;
106    }
107    };
108  14 desc.setHandler(handler);
109  14 desc.setRequired(true);
110  14 desc.setMultivalued(false);
111  14 addFieldDescriptor(desc);
112   
113    // -- validation code for: _and
114  14 fieldValidator = new org.exolab.castor.xml.FieldValidator();
115  14 fieldValidator.setMinOccurs(1);
116    { // -- local scope
117  14 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
118  14 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
119  14 fieldValidator.setValidator(typeValidator);
120    }
121  14 desc.setValidator(fieldValidator);
122    // -- initialize element descriptors
123   
124    // -- _matcherSetList
125  14 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  14 handler = new org.exolab.castor.xml.XMLFieldHandler()
130    {
 
131  10 toggle public java.lang.Object getValue(java.lang.Object object)
132    throws IllegalStateException
133    {
134  10 CompoundMatcher target = (CompoundMatcher) object;
135  10 return target.getMatcherSet();
136    }
137   
 
138  8 toggle public void setValue(java.lang.Object object, java.lang.Object value)
139    throws IllegalStateException, IllegalArgumentException
140    {
141  8 try
142    {
143  8 CompoundMatcher target = (CompoundMatcher) object;
144  8 target.addMatcherSet(
145    (jalview.schemabinding.version2.MatcherSet) value);
146    } catch (java.lang.Exception ex)
147    {
148  0 throw new IllegalStateException(ex.toString());
149    }
150    }
151   
 
152  0 toggle public void resetValue(Object object)
153    throws IllegalStateException, IllegalArgumentException
154    {
155  0 try
156    {
157  0 CompoundMatcher target = (CompoundMatcher) object;
158  0 target.removeAllMatcherSet();
159    } catch (java.lang.Exception ex)
160    {
161  0 throw new IllegalStateException(ex.toString());
162    }
163    }
164   
 
165  8 toggle public java.lang.Object newInstance(java.lang.Object parent)
166    {
167  8 return new jalview.schemabinding.version2.MatcherSet();
168    }
169    };
170  14 desc.setHandler(handler);
171  14 desc.setRequired(true);
172  14 desc.setMultivalued(true);
173  14 addFieldDescriptor(desc);
174   
175    // -- validation code for: _matcherSetList
176  14 fieldValidator = new org.exolab.castor.xml.FieldValidator();
177  14 fieldValidator.setMinOccurs(2);
178  14 fieldValidator.setMaxOccurs(2);
179    { // -- local scope
180    }
181  14 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  0 toggle public org.exolab.castor.mapping.AccessMode getAccessMode()
194    {
195  0 return null;
196    }
197   
198    /**
199    * Method getIdentity.
200    *
201    * @return the identity field, null if this class has no identity.
202    */
 
203  10 toggle public org.exolab.castor.mapping.FieldDescriptor getIdentity()
204    {
205  10 return super.getIdentity();
206    }
207   
208    /**
209    * Method getJavaClass.
210    *
211    * @return the Java class represented by this descriptor.
212    */
 
213  10 toggle public java.lang.Class getJavaClass()
214    {
215  10 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  4 toggle public java.lang.String getNameSpacePrefix()
224    {
225  4 return _nsPrefix;
226    }
227   
228    /**
229    * Method getNameSpaceURI.
230    *
231    * @return the namespace URI used when marshaling and unmarshaling as XML.
232    */
 
233  4 toggle public java.lang.String getNameSpaceURI()
234    {
235  4 return _nsURI;
236    }
237   
238    /**
239    * Method getValidator.
240    *
241    * @return a specific validator for the class described by this
242    * ClassDescriptor.
243    */
 
244  6 toggle public org.exolab.castor.xml.TypeValidator getValidator()
245    {
246  6 return this;
247    }
248   
249    /**
250    * Method getXMLName.
251    *
252    * @return the XML Name for the Class being described.
253    */
 
254  28 toggle public java.lang.String getXMLName()
255    {
256  28 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  0 toggle public boolean isElementDefinition()
266    {
267  0 return _elementDefinition;
268    }
269   
270    }