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 * Class UnitTestCaseChoice. 12 * 13 * @version $Revision$ $Date$ 14 */ 15 public class UnitTestCaseChoice implements java.io.Serializable { 16 17 18 //--------------------------/ 19 //- Class/Member Variables -/ 20 //--------------------------/ 21 22 /** 23 * This element is used only for a MarshallingTest and is 24 * optional. It specifies the mapping file to be used (if 25 * any). 26 * 27 */ 28 private java.lang.String _mapping_File; 29 30 /** 31 * This element is used only for a SchemaTest and is required 32 * for a SchemaTest. It gives the name of the schema to read + 33 * write. 34 * If the value if this element is '' then the CTF will use 35 * all of 36 * the schemas present in the directory or jar. 37 * 38 */ 39 private java.lang.String _schema; 40 41 42 //----------------/ 43 //- Constructors -/ 44 //----------------/ 45 46 public UnitTestCaseChoice() { 47 super(); 48 } 49 50 51 //-----------/ 52 //- Methods -/ 53 //-----------/ 54 55 /** 56 * Returns the value of field 'mapping_File'. The field 57 * 'mapping_File' has the following description: This element 58 * is used only for a MarshallingTest and is 59 * optional. It specifies the mapping file to be used (if 60 * any). 61 * 62 * 63 * @return the value of field 'Mapping_File'. 64 */ 65 public java.lang.String getMapping_File( 66 ) { 67 return this._mapping_File; 68 } 69 70 /** 71 * Returns the value of field 'schema'. The field 'schema' has 72 * the following description: This element is used only for a 73 * SchemaTest and is required 74 * for a SchemaTest. It gives the name of the schema to read + 75 * write. 76 * If the value if this element is '' then the CTF will use 77 * all of 78 * the schemas present in the directory or jar. 79 * 80 * 81 * @return the value of field 'Schema'. 82 */ 83 public java.lang.String getSchema( 84 ) { 85 return this._schema; 86 } 87 88 /** 89 * Method isValid. 90 * 91 * @return true if this object is valid according to the schema 92 */ 93 public boolean isValid( 94 ) { 95 try { 96 validate(); 97 } catch (org.exolab.castor.xml.ValidationException vex) { 98 return false; 99 } 100 return true; 101 } 102 103 /** 104 * 105 * 106 * @param out 107 * @throws org.exolab.castor.xml.MarshalException if object is 108 * null or if any SAXException is thrown during marshaling 109 * @throws org.exolab.castor.xml.ValidationException if this 110 * object is an invalid instance according to the schema 111 */ 112 public void marshal( 113 final java.io.Writer out) 114 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { 115 org.exolab.castor.xml.Marshaller.marshal(this, out); 116 } 117 118 /** 119 * 120 * 121 * @param handler 122 * @throws java.io.IOException if an IOException occurs during 123 * marshaling 124 * @throws org.exolab.castor.xml.ValidationException if this 125 * object is an invalid instance according to the schema 126 * @throws org.exolab.castor.xml.MarshalException if object is 127 * null or if any SAXException is thrown during marshaling 128 */ 129 public void marshal( 130 final org.xml.sax.ContentHandler handler) 131 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { 132 org.exolab.castor.xml.Marshaller.marshal(this, handler); 133 } 134 135 /** 136 * Sets the value of field 'mapping_File'. The field 137 * 'mapping_File' has the following description: This element 138 * is used only for a MarshallingTest and is 139 * optional. It specifies the mapping file to be used (if 140 * any). 141 * 142 * 143 * @param mapping_File the value of field 'mapping_File'. 144 */ 145 public void setMapping_File( 146 final java.lang.String mapping_File) { 147 this._mapping_File = mapping_File; 148 } 149 150 /** 151 * Sets the value of field 'schema'. The field 'schema' has the 152 * following description: This element is used only for a 153 * SchemaTest and is required 154 * for a SchemaTest. It gives the name of the schema to read + 155 * write. 156 * If the value if this element is '' then the CTF will use 157 * all of 158 * the schemas present in the directory or jar. 159 * 160 * 161 * @param schema the value of field 'schema'. 162 */ 163 public void setSchema( 164 final java.lang.String schema) { 165 this._schema = schema; 166 } 167 168 /** 169 * Method unmarshal. 170 * 171 * @param reader 172 * @throws org.exolab.castor.xml.MarshalException if object is 173 * null or if any SAXException is thrown during marshaling 174 * @throws org.exolab.castor.xml.ValidationException if this 175 * object is an invalid instance according to the schema 176 * @return the unmarshaled 177 * org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice 178 */ 179 public static org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice unmarshal( 180 final java.io.Reader reader) 181 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException { 182 return (org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.UnitTestCaseChoice.class, reader); 183 } 184 185 /** 186 * 187 * 188 * @throws org.exolab.castor.xml.ValidationException if this 189 * object is an invalid instance according to the schema 190 */ 191 public void validate( 192 ) 193 throws org.exolab.castor.xml.ValidationException { 194 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator(); 195 validator.validate(this); 196 } 197 198 }