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