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   * A parameter to be provided to a method.
12   *  
13   * 
14   * @version $Revision$ $Date$
15   */
16  public class Value implements java.io.Serializable {
17  
18  
19        //--------------------------/
20       //- Class/Member Variables -/
21      //--------------------------/
22  
23      /**
24       * internal content storage
25       */
26      private java.lang.String _content = "";
27  
28      /**
29       * Field _type.
30       */
31      private java.lang.String _type;
32  
33  
34        //----------------/
35       //- Constructors -/
36      //----------------/
37  
38      public Value() {
39          super();
40          setContent("");
41      }
42  
43      public Value(final java.lang.String defaultValue) {
44          try {
45              setContent( new java.lang.String(defaultValue));
46           } catch(Exception e) {
47              throw new RuntimeException("Unable to cast default value for simple content!");
48           } 
49      }
50  
51  
52        //-----------/
53       //- Methods -/
54      //-----------/
55  
56      /**
57       * Returns the value of field 'content'. The field 'content'
58       * has the following description: internal content storage
59       * 
60       * @return the value of field 'Content'.
61       */
62      public java.lang.String getContent(
63      ) {
64          return this._content;
65      }
66  
67      /**
68       * Returns the value of field 'type'.
69       * 
70       * @return the value of field 'Type'.
71       */
72      public java.lang.String getType(
73      ) {
74          return this._type;
75      }
76  
77      /**
78       * Method isValid.
79       * 
80       * @return true if this object is valid according to the schema
81       */
82      public boolean isValid(
83      ) {
84          try {
85              validate();
86          } catch (org.exolab.castor.xml.ValidationException vex) {
87              return false;
88          }
89          return true;
90      }
91  
92      /**
93       * 
94       * 
95       * @param out
96       * @throws org.exolab.castor.xml.MarshalException if object is
97       * null or if any SAXException is thrown during marshaling
98       * @throws org.exolab.castor.xml.ValidationException if this
99       * object is an invalid instance according to the schema
100      */
101     public void marshal(
102             final java.io.Writer out)
103     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
104         org.exolab.castor.xml.Marshaller.marshal(this, out);
105     }
106 
107     /**
108      * 
109      * 
110      * @param handler
111      * @throws java.io.IOException if an IOException occurs during
112      * marshaling
113      * @throws org.exolab.castor.xml.ValidationException if this
114      * object is an invalid instance according to the schema
115      * @throws org.exolab.castor.xml.MarshalException if object is
116      * null or if any SAXException is thrown during marshaling
117      */
118     public void marshal(
119             final org.xml.sax.ContentHandler handler)
120     throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
121         org.exolab.castor.xml.Marshaller.marshal(this, handler);
122     }
123 
124     /**
125      * Sets the value of field 'content'. The field 'content' has
126      * the following description: internal content storage
127      * 
128      * @param content the value of field 'content'.
129      */
130     public void setContent(
131             final java.lang.String content) {
132         this._content = content;
133     }
134 
135     /**
136      * Sets the value of field 'type'.
137      * 
138      * @param type the value of field 'type'.
139      */
140     public void setType(
141             final java.lang.String type) {
142         this._type = type;
143     }
144 
145     /**
146      * Method unmarshal.
147      * 
148      * @param reader
149      * @throws org.exolab.castor.xml.MarshalException if object is
150      * null or if any SAXException is thrown during marshaling
151      * @throws org.exolab.castor.xml.ValidationException if this
152      * object is an invalid instance according to the schema
153      * @return the unmarshaled
154      * org.exolab.castor.tests.framework.testDescriptor.Value
155      */
156     public static org.exolab.castor.tests.framework.testDescriptor.Value unmarshal(
157             final java.io.Reader reader)
158     throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
159         return (org.exolab.castor.tests.framework.testDescriptor.Value) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.tests.framework.testDescriptor.Value.class, reader);
160     }
161 
162     /**
163      * 
164      * 
165      * @throws org.exolab.castor.xml.ValidationException if this
166      * object is an invalid instance according to the schema
167      */
168     public void validate(
169     )
170     throws org.exolab.castor.xml.ValidationException {
171         org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
172         validator.validate(this);
173     }
174 
175 }