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.mapping.xml;
9
10 /**
11 * Class Container.
12 *
13 * @version $Revision$ $Date$
14 */
15 @SuppressWarnings("serial")
16 public class Container implements java.io.Serializable {
17
18
19 //--------------------------/
20 //- Class/Member Variables -/
21 //--------------------------/
22
23 /**
24 * Field _name.
25 */
26 private java.lang.String _name;
27
28 /**
29 * Field _type.
30 */
31 private java.lang.String _type;
32
33 /**
34 * Field _required.
35 */
36 private boolean _required = false;
37
38 /**
39 * keeps track of state for field: _required
40 */
41 private boolean _has_required;
42
43 /**
44 * Field _direct.
45 */
46 private boolean _direct = false;
47
48 /**
49 * keeps track of state for field: _direct
50 */
51 private boolean _has_direct;
52
53 /**
54 * Field _getMethod.
55 */
56 private java.lang.String _getMethod;
57
58 /**
59 * Field _setMethod.
60 */
61 private java.lang.String _setMethod;
62
63 /**
64 * Field _createMethod.
65 */
66 private java.lang.String _createMethod;
67
68 /**
69 * Field _description.
70 */
71 private java.lang.String _description;
72
73 /**
74 * The 'field' element is used to describe the property of a
75 * Java object.
76 *
77 */
78 private org.exolab.castor.mapping.xml.FieldMapping _fieldMapping;
79
80
81 //----------------/
82 //- Constructors -/
83 //----------------/
84
85 public Container() {
86 super();
87 }
88
89
90 //-----------/
91 //- Methods -/
92 //-----------/
93
94 /**
95 */
96 public void deleteDirect(
97 ) {
98 this._has_direct= false;
99 }
100
101 /**
102 */
103 public void deleteRequired(
104 ) {
105 this._has_required= false;
106 }
107
108 /**
109 * Returns the value of field 'createMethod'.
110 *
111 * @return the value of field 'CreateMethod'.
112 */
113 public java.lang.String getCreateMethod(
114 ) {
115 return this._createMethod;
116 }
117
118 /**
119 * Returns the value of field 'description'.
120 *
121 * @return the value of field 'Description'.
122 */
123 public java.lang.String getDescription(
124 ) {
125 return this._description;
126 }
127
128 /**
129 * Returns the value of field 'direct'.
130 *
131 * @return the value of field 'Direct'.
132 */
133 public boolean getDirect(
134 ) {
135 return this._direct;
136 }
137
138 /**
139 * Returns the value of field 'fieldMapping'. The field
140 * 'fieldMapping' has the following description: The 'field'
141 * element is used to describe the property of a Java object.
142 *
143 *
144 * @return the value of field 'FieldMapping'.
145 */
146 public org.exolab.castor.mapping.xml.FieldMapping getFieldMapping(
147 ) {
148 return this._fieldMapping;
149 }
150
151 /**
152 * Returns the value of field 'getMethod'.
153 *
154 * @return the value of field 'GetMethod'.
155 */
156 public java.lang.String getGetMethod(
157 ) {
158 return this._getMethod;
159 }
160
161 /**
162 * Returns the value of field 'name'.
163 *
164 * @return the value of field 'Name'.
165 */
166 public java.lang.String getName(
167 ) {
168 return this._name;
169 }
170
171 /**
172 * Returns the value of field 'required'.
173 *
174 * @return the value of field 'Required'.
175 */
176 public boolean getRequired(
177 ) {
178 return this._required;
179 }
180
181 /**
182 * Returns the value of field 'setMethod'.
183 *
184 * @return the value of field 'SetMethod'.
185 */
186 public java.lang.String getSetMethod(
187 ) {
188 return this._setMethod;
189 }
190
191 /**
192 * Returns the value of field 'type'.
193 *
194 * @return the value of field 'Type'.
195 */
196 public java.lang.String getType(
197 ) {
198 return this._type;
199 }
200
201 /**
202 * Method hasDirect.
203 *
204 * @return true if at least one Direct has been added
205 */
206 public boolean hasDirect(
207 ) {
208 return this._has_direct;
209 }
210
211 /**
212 * Method hasRequired.
213 *
214 * @return true if at least one Required has been added
215 */
216 public boolean hasRequired(
217 ) {
218 return this._has_required;
219 }
220
221 /**
222 * Returns the value of field 'direct'.
223 *
224 * @return the value of field 'Direct'.
225 */
226 public boolean isDirect(
227 ) {
228 return this._direct;
229 }
230
231 /**
232 * Returns the value of field 'required'.
233 *
234 * @return the value of field 'Required'.
235 */
236 public boolean isRequired(
237 ) {
238 return this._required;
239 }
240
241 /**
242 * Method isValid.
243 *
244 * @return true if this object is valid according to the schema
245 */
246 public boolean isValid(
247 ) {
248 try {
249 validate();
250 } catch (org.exolab.castor.xml.ValidationException vex) {
251 return false;
252 }
253 return true;
254 }
255
256 /**
257 *
258 *
259 * @param out
260 * @throws org.exolab.castor.xml.MarshalException if object is
261 * null or if any SAXException is thrown during marshaling
262 * @throws org.exolab.castor.xml.ValidationException if this
263 * object is an invalid instance according to the schema
264 */
265 public void marshal(
266 final java.io.Writer out)
267 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
268 org.exolab.castor.xml.Marshaller.marshal(this, out);
269 }
270
271 /**
272 *
273 *
274 * @param handler
275 * @throws java.io.IOException if an IOException occurs during
276 * marshaling
277 * @throws org.exolab.castor.xml.ValidationException if this
278 * object is an invalid instance according to the schema
279 * @throws org.exolab.castor.xml.MarshalException if object is
280 * null or if any SAXException is thrown during marshaling
281 */
282 public void marshal(
283 final org.xml.sax.ContentHandler handler)
284 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
285 org.exolab.castor.xml.Marshaller.marshal(this, handler);
286 }
287
288 /**
289 * Sets the value of field 'createMethod'.
290 *
291 * @param createMethod the value of field 'createMethod'.
292 */
293 public void setCreateMethod(
294 final java.lang.String createMethod) {
295 this._createMethod = createMethod;
296 }
297
298 /**
299 * Sets the value of field 'description'.
300 *
301 * @param description the value of field 'description'.
302 */
303 public void setDescription(
304 final java.lang.String description) {
305 this._description = description;
306 }
307
308 /**
309 * Sets the value of field 'direct'.
310 *
311 * @param direct the value of field 'direct'.
312 */
313 public void setDirect(
314 final boolean direct) {
315 this._direct = direct;
316 this._has_direct = true;
317 }
318
319 /**
320 * Sets the value of field 'fieldMapping'. The field
321 * 'fieldMapping' has the following description: The 'field'
322 * element is used to describe the property of a Java object.
323 *
324 *
325 * @param fieldMapping the value of field 'fieldMapping'.
326 */
327 public void setFieldMapping(
328 final org.exolab.castor.mapping.xml.FieldMapping fieldMapping) {
329 this._fieldMapping = fieldMapping;
330 }
331
332 /**
333 * Sets the value of field 'getMethod'.
334 *
335 * @param getMethod the value of field 'getMethod'.
336 */
337 public void setGetMethod(
338 final java.lang.String getMethod) {
339 this._getMethod = getMethod;
340 }
341
342 /**
343 * Sets the value of field 'name'.
344 *
345 * @param name the value of field 'name'.
346 */
347 public void setName(
348 final java.lang.String name) {
349 this._name = name;
350 }
351
352 /**
353 * Sets the value of field 'required'.
354 *
355 * @param required the value of field 'required'.
356 */
357 public void setRequired(
358 final boolean required) {
359 this._required = required;
360 this._has_required = true;
361 }
362
363 /**
364 * Sets the value of field 'setMethod'.
365 *
366 * @param setMethod the value of field 'setMethod'.
367 */
368 public void setSetMethod(
369 final java.lang.String setMethod) {
370 this._setMethod = setMethod;
371 }
372
373 /**
374 * Sets the value of field 'type'.
375 *
376 * @param type the value of field 'type'.
377 */
378 public void setType(
379 final java.lang.String type) {
380 this._type = type;
381 }
382
383 /**
384 * Method unmarshal.
385 *
386 * @param reader
387 * @throws org.exolab.castor.xml.MarshalException if object is
388 * null or if any SAXException is thrown during marshaling
389 * @throws org.exolab.castor.xml.ValidationException if this
390 * object is an invalid instance according to the schema
391 * @return the unmarshaled
392 * org.exolab.castor.mapping.xml.Container
393 */
394 public static org.exolab.castor.mapping.xml.Container unmarshal(
395 final java.io.Reader reader)
396 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
397 return (org.exolab.castor.mapping.xml.Container) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.mapping.xml.Container.class, reader);
398 }
399
400 /**
401 *
402 *
403 * @throws org.exolab.castor.xml.ValidationException if this
404 * object is an invalid instance according to the schema
405 */
406 public void validate(
407 )
408 throws org.exolab.castor.xml.ValidationException {
409 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
410 validator.validate(this);
411 }
412
413 }