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 * If you expect a non-zero number of differences when comparing
12 * schemas,
13 * add one of these elements and provide the FailureStep attribute
14 * to say which step this difference applies to.
15 *
16 *
17 * @version $Revision$ $Date$
18 */
19 public class SchemaDifferencesType implements java.io.Serializable {
20
21
22 //--------------------------/
23 //- Class/Member Variables -/
24 //--------------------------/
25
26 /**
27 * internal content storage
28 */
29 private int _content;
30
31 /**
32 * keeps track of state for field: _content
33 */
34 private boolean _has_content;
35
36 /**
37 * Field _failureStep.
38 */
39 private org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType _failureStep;
40
41
42 //----------------/
43 //- Constructors -/
44 //----------------/
45
46 public SchemaDifferencesType() {
47 super();
48 }
49
50 public SchemaDifferencesType(final java.lang.String defaultValue) {
51 try {
52 setContent(new java.lang.Integer(defaultValue).intValue());
53 } catch(Exception e) {
54 throw new RuntimeException("Unable to cast default value for simple content!");
55 }
56 }
57
58
59 //-----------/
60 //- Methods -/
61 //-----------/
62
63 /**
64 */
65 public void deleteContent(
66 ) {
67 this._has_content= false;
68 }
69
70 /**
71 * Returns the value of field 'content'. The field 'content'
72 * has the following description: internal content storage
73 *
74 * @return the value of field 'Content'.
75 */
76 public int getContent(
77 ) {
78 return this._content;
79 }
80
81 /**
82 * Returns the value of field 'failureStep'.
83 *
84 * @return the value of field 'FailureStep'.
85 */
86 public org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType getFailureStep(
87 ) {
88 return this._failureStep;
89 }
90
91 /**
92 * Method hasContent.
93 *
94 * @return true if at least one Content has been added
95 */
96 public boolean hasContent(
97 ) {
98 return this._has_content;
99 }
100
101 /**
102 * Method isValid.
103 *
104 * @return true if this object is valid according to the schema
105 */
106 public boolean isValid(
107 ) {
108 try {
109 validate();
110 } catch (org.exolab.castor.xml.ValidationException vex) {
111 return false;
112 }
113 return true;
114 }
115
116 /**
117 *
118 *
119 * @param out
120 * @throws org.exolab.castor.xml.MarshalException if object is
121 * null or if any SAXException is thrown during marshaling
122 * @throws org.exolab.castor.xml.ValidationException if this
123 * object is an invalid instance according to the schema
124 */
125 public void marshal(
126 final java.io.Writer out)
127 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
128 org.exolab.castor.xml.Marshaller.marshal(this, out);
129 }
130
131 /**
132 *
133 *
134 * @param handler
135 * @throws java.io.IOException if an IOException occurs during
136 * marshaling
137 * @throws org.exolab.castor.xml.ValidationException if this
138 * object is an invalid instance according to the schema
139 * @throws org.exolab.castor.xml.MarshalException if object is
140 * null or if any SAXException is thrown during marshaling
141 */
142 public void marshal(
143 final org.xml.sax.ContentHandler handler)
144 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
145 org.exolab.castor.xml.Marshaller.marshal(this, handler);
146 }
147
148 /**
149 * Sets the value of field 'content'. The field 'content' has
150 * the following description: internal content storage
151 *
152 * @param content the value of field 'content'.
153 */
154 public void setContent(
155 final int content) {
156 this._content = content;
157 this._has_content = true;
158 }
159
160 /**
161 * Sets the value of field 'failureStep'.
162 *
163 * @param failureStep the value of field 'failureStep'.
164 */
165 public void setFailureStep(
166 final org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType failureStep) {
167 this._failureStep = failureStep;
168 }
169
170 /**
171 * Method unmarshal.
172 *
173 * @param reader
174 * @throws org.exolab.castor.xml.MarshalException if object is
175 * null or if any SAXException is thrown during marshaling
176 * @throws org.exolab.castor.xml.ValidationException if this
177 * object is an invalid instance according to the schema
178 * @return the unmarshaled
179 * org.exolab.castor.tests.framework.testDescriptor.SchemaDifferencesType
180 */
181 public static org.exolab.castor.tests.framework.testDescriptor.SchemaDifferencesType unmarshal(
182 final java.io.Reader reader)
183 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
184 return (org.exolab.castor.tests.framework.testDescriptor.SchemaDifferencesType) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.SchemaDifferencesType.class, reader);
185 }
186
187 /**
188 *
189 *
190 * @throws org.exolab.castor.xml.ValidationException if this
191 * object is an invalid instance according to the schema
192 */
193 public void validate(
194 )
195 throws org.exolab.castor.xml.ValidationException {
196 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
197 validator.validate(this);
198 }
199
200 }