View Javadoc
1   /*
2    * This class was automatically generated with 
3    * <a href="http://www.castor.org">Castor 1.3.1</a>, using an XML
4    * Schema.
5    * $Id$
6    */
7   
8   package org.exolab.castor.tests.framework.testDescriptor;
9   
10  /**
11   * This element specifies an optional user-provided test. A user-
12   *  provided test consists of a test class name to be instantiated
13   *  and a non-static method to call for the method.
14   *  
15   * 
16   * @version $Revision$ $Date$
17   */
18  public class CustomTestType implements java.io.Serializable {
19  
20  
21        //--------------------------/
22       //- Class/Member Variables -/
23      //--------------------------/
24  
25      /**
26       * Field _testClass.
27       */
28      private java.lang.String _testClass;
29  
30      /**
31       * Field _methods.
32       */
33      private org.exolab.castor.tests.framework.testDescriptor.Methods _methods;
34  
35  
36        //----------------/
37       //- Constructors -/
38      //----------------/
39  
40      public CustomTestType() {
41          super();
42      }
43  
44  
45        //-----------/
46       //- Methods -/
47      //-----------/
48  
49      /**
50       * Returns the value of field 'methods'.
51       * 
52       * @return the value of field 'Methods'.
53       */
54      public org.exolab.castor.tests.framework.testDescriptor.Methods getMethods(
55      ) {
56          return this._methods;
57      }
58  
59      /**
60       * Returns the value of field 'testClass'.
61       * 
62       * @return the value of field 'TestClass'.
63       */
64      public java.lang.String getTestClass(
65      ) {
66          return this._testClass;
67      }
68  
69      /**
70       * Method isValid.
71       * 
72       * @return true if this object is valid according to the schema
73       */
74      public boolean isValid(
75      ) {
76          try {
77              validate();
78          } catch (org.exolab.castor.xml.ValidationException vex) {
79              return false;
80          }
81          return true;
82      }
83  
84      /**
85       * 
86       * 
87       * @param out
88       * @throws org.exolab.castor.xml.MarshalException if object is
89       * null or if any SAXException is thrown during marshaling
90       * @throws org.exolab.castor.xml.ValidationException if this
91       * object is an invalid instance according to the schema
92       */
93      public void marshal(
94              final java.io.Writer out)
95      throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
96          org.exolab.castor.xml.Marshaller.marshal(this, out);
97      }
98  
99      /**
100      * 
101      * 
102      * @param handler
103      * @throws java.io.IOException if an IOException occurs during
104      * marshaling
105      * @throws org.exolab.castor.xml.ValidationException if this
106      * object is an invalid instance according to the schema
107      * @throws org.exolab.castor.xml.MarshalException if object is
108      * null or if any SAXException is thrown during marshaling
109      */
110     public void marshal(
111             final org.xml.sax.ContentHandler handler)
112     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
113         org.exolab.castor.xml.Marshaller.marshal(this, handler);
114     }
115 
116     /**
117      * Sets the value of field 'methods'.
118      * 
119      * @param methods the value of field 'methods'.
120      */
121     public void setMethods(
122             final org.exolab.castor.tests.framework.testDescriptor.Methods methods) {
123         this._methods = methods;
124     }
125 
126     /**
127      * Sets the value of field 'testClass'.
128      * 
129      * @param testClass the value of field 'testClass'.
130      */
131     public void setTestClass(
132             final java.lang.String testClass) {
133         this._testClass = testClass;
134     }
135 
136     /**
137      * Method unmarshal.
138      * 
139      * @param reader
140      * @throws org.exolab.castor.xml.MarshalException if object is
141      * null or if any SAXException is thrown during marshaling
142      * @throws org.exolab.castor.xml.ValidationException if this
143      * object is an invalid instance according to the schema
144      * @return the unmarshaled
145      * org.exolab.castor.tests.framework.testDescriptor.CustomTestType
146      */
147     public static org.exolab.castor.tests.framework.testDescriptor.CustomTestType unmarshal(
148             final java.io.Reader reader)
149     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
150         return (org.exolab.castor.tests.framework.testDescriptor.CustomTestType) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.CustomTestType.class, reader);
151     }
152 
153     /**
154      * 
155      * 
156      * @throws org.exolab.castor.xml.ValidationException if this
157      * object is an invalid instance according to the schema
158      */
159     public void validate(
160     )
161     throws org.exolab.castor.xml.ValidationException {
162         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
163         validator.validate(this);
164     }
165 
166 }