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   * The definition of the Root Type in the object model. Contains
12   * two
13   *  boolean attributes: random and dump.
14   *  If random is set to true, a test using randomized objects will
15   *  be executed. If dump is set to true, the object will be dumped
16   *  to specific files.
17   *  
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class RootType extends org.exolab.castor.tests.framework.testDescriptor.StringType 
22  implements java.io.Serializable
23  {
24  
25  
26        //--------------------------/
27       //- Class/Member Variables -/
28      //--------------------------/
29  
30      /**
31       * internal content storage
32       */
33      private java.lang.String _content = "";
34  
35      /**
36       * Field _random.
37       */
38      private boolean _random = false;
39  
40      /**
41       * keeps track of state for field: _random
42       */
43      private boolean _has_random;
44  
45      /**
46       * Field _dump.
47       */
48      private boolean _dump = false;
49  
50      /**
51       * keeps track of state for field: _dump
52       */
53      private boolean _has_dump;
54  
55  
56        //----------------/
57       //- Constructors -/
58      //----------------/
59  
60      public RootType() {
61          super();
62          setContent("");
63      }
64  
65      public RootType(final java.lang.String defaultValue) {
66          try {
67              setContent( new java.lang.String(defaultValue));
68           } catch(Exception e) {
69              throw new RuntimeException("Unable to cast default value for simple content!");
70           } 
71      }
72  
73  
74        //-----------/
75       //- Methods -/
76      //-----------/
77  
78      /**
79       */
80      public void deleteDump(
81      ) {
82          this._has_dump= false;
83      }
84  
85      /**
86       */
87      public void deleteRandom(
88      ) {
89          this._has_random= false;
90      }
91  
92      /**
93       * Returns the value of field 'content'. The field 'content'
94       * has the following description: internal content storage
95       * 
96       * @return the value of field 'Content'.
97       */
98      public java.lang.String getContent(
99      ) {
100         return this._content;
101     }
102 
103     /**
104      * Returns the value of field 'dump'.
105      * 
106      * @return the value of field 'Dump'.
107      */
108     public boolean getDump(
109     ) {
110         return this._dump;
111     }
112 
113     /**
114      * Returns the value of field 'random'.
115      * 
116      * @return the value of field 'Random'.
117      */
118     public boolean getRandom(
119     ) {
120         return this._random;
121     }
122 
123     /**
124      * Method hasDump.
125      * 
126      * @return true if at least one Dump has been added
127      */
128     public boolean hasDump(
129     ) {
130         return this._has_dump;
131     }
132 
133     /**
134      * Method hasRandom.
135      * 
136      * @return true if at least one Random has been added
137      */
138     public boolean hasRandom(
139     ) {
140         return this._has_random;
141     }
142 
143     /**
144      * Returns the value of field 'dump'.
145      * 
146      * @return the value of field 'Dump'.
147      */
148     public boolean isDump(
149     ) {
150         return this._dump;
151     }
152 
153     /**
154      * Returns the value of field 'random'.
155      * 
156      * @return the value of field 'Random'.
157      */
158     public boolean isRandom(
159     ) {
160         return this._random;
161     }
162 
163     /**
164      * Method isValid.
165      * 
166      * @return true if this object is valid according to the schema
167      */
168     public boolean isValid(
169     ) {
170         try {
171             validate();
172         } catch (org.exolab.castor.xml.ValidationException vex) {
173             return false;
174         }
175         return true;
176     }
177 
178     /**
179      * 
180      * 
181      * @param out
182      * @throws org.exolab.castor.xml.MarshalException if object is
183      * null or if any SAXException is thrown during marshaling
184      * @throws org.exolab.castor.xml.ValidationException if this
185      * object is an invalid instance according to the schema
186      */
187     public void marshal(
188             final java.io.Writer out)
189     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
190         org.exolab.castor.xml.Marshaller.marshal(this, out);
191     }
192 
193     /**
194      * 
195      * 
196      * @param handler
197      * @throws java.io.IOException if an IOException occurs during
198      * marshaling
199      * @throws org.exolab.castor.xml.ValidationException if this
200      * object is an invalid instance according to the schema
201      * @throws org.exolab.castor.xml.MarshalException if object is
202      * null or if any SAXException is thrown during marshaling
203      */
204     public void marshal(
205             final org.xml.sax.ContentHandler handler)
206     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
207         org.exolab.castor.xml.Marshaller.marshal(this, handler);
208     }
209 
210     /**
211      * Sets the value of field 'content'. The field 'content' has
212      * the following description: internal content storage
213      * 
214      * @param content the value of field 'content'.
215      */
216     public void setContent(
217             final java.lang.String content) {
218         this._content = content;
219     }
220 
221     /**
222      * Sets the value of field 'dump'.
223      * 
224      * @param dump the value of field 'dump'.
225      */
226     public void setDump(
227             final boolean dump) {
228         this._dump = dump;
229         this._has_dump = true;
230     }
231 
232     /**
233      * Sets the value of field 'random'.
234      * 
235      * @param random the value of field 'random'.
236      */
237     public void setRandom(
238             final boolean random) {
239         this._random = random;
240         this._has_random = true;
241     }
242 
243     /**
244      * Method unmarshal.
245      * 
246      * @param reader
247      * @throws org.exolab.castor.xml.MarshalException if object is
248      * null or if any SAXException is thrown during marshaling
249      * @throws org.exolab.castor.xml.ValidationException if this
250      * object is an invalid instance according to the schema
251      * @return the unmarshaled
252      * org.exolab.castor.tests.framework.testDescriptor.StringType
253      */
254     public static org.exolab.castor.tests.framework.testDescriptor.StringType unmarshal(
255             final java.io.Reader reader)
256     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
257         return (org.exolab.castor.tests.framework.testDescriptor.StringType) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.RootType.class, reader);
258     }
259 
260     /**
261      * 
262      * 
263      * @throws org.exolab.castor.xml.ValidationException if this
264      * object is an invalid instance according to the schema
265      */
266     public void validate(
267     )
268     throws org.exolab.castor.xml.ValidationException {
269         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
270         validator.validate(this);
271     }
272 
273 }