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.xml.schema.annotations.jdo;
9
10 /**
11 * Element 'column' is used to specify the column where the
12 * property of an object will be saved.
13 *
14 *
15 * @version $Revision$ $Date$
16 */
17 @SuppressWarnings("serial")
18 public class Column extends org.exolab.castor.xml.schema.annotations.jdo.ReadonlyDirtyType
19 implements java.io.Serializable
20 {
21
22
23 //--------------------------/
24 //- Class/Member Variables -/
25 //--------------------------/
26
27 /**
28 * Attribute 'name' is used to specify the
29 * name of the column.
30 *
31 */
32 private java.lang.String _name;
33
34 /**
35 * Attribute 'type' is used to specify the
36 * JDO-type of the column.
37 *
38 */
39 private java.lang.String _type;
40
41 /**
42 * Specifies if this field accepts NULL
43 * values or not.
44 *
45 */
46 private boolean _acceptNull = true;
47
48 /**
49 * keeps track of state for field: _acceptNull
50 */
51 private boolean _has_acceptNull;
52
53
54 //----------------/
55 //- Constructors -/
56 //----------------/
57
58 public Column() {
59 super();
60 }
61
62
63 //-----------/
64 //- Methods -/
65 //-----------/
66
67 /**
68 */
69 public void deleteAcceptNull(
70 ) {
71 this._has_acceptNull= false;
72 }
73
74 /**
75 * Returns the value of field 'acceptNull'. The field
76 * 'acceptNull' has the following description: Specifies if
77 * this field accepts NULL
78 * values or not.
79 *
80 *
81 * @return the value of field 'AcceptNull'.
82 */
83 public boolean getAcceptNull(
84 ) {
85 return this._acceptNull;
86 }
87
88 /**
89 * Returns the value of field 'name'. The field 'name' has the
90 * following description: Attribute 'name' is used to specify
91 * the
92 * name of the column.
93 *
94 *
95 * @return the value of field 'Name'.
96 */
97 public java.lang.String getName(
98 ) {
99 return this._name;
100 }
101
102 /**
103 * Returns the value of field 'type'. The field 'type' has the
104 * following description: Attribute 'type' is used to specify
105 * the
106 * JDO-type of the column.
107 *
108 *
109 * @return the value of field 'Type'.
110 */
111 public java.lang.String getType(
112 ) {
113 return this._type;
114 }
115
116 /**
117 * Method hasAcceptNull.
118 *
119 * @return true if at least one AcceptNull has been added
120 */
121 public boolean hasAcceptNull(
122 ) {
123 return this._has_acceptNull;
124 }
125
126 /**
127 * Returns the value of field 'acceptNull'. The field
128 * 'acceptNull' has the following description: Specifies if
129 * this field accepts NULL
130 * values or not.
131 *
132 *
133 * @return the value of field 'AcceptNull'.
134 */
135 public boolean isAcceptNull(
136 ) {
137 return this._acceptNull;
138 }
139
140 /**
141 * Method isValid.
142 *
143 * @return true if this object is valid according to the schema
144 */
145 public boolean isValid(
146 ) {
147 try {
148 validate();
149 } catch (org.exolab.castor.xml.ValidationException vex) {
150 return false;
151 }
152 return true;
153 }
154
155 /**
156 *
157 *
158 * @param out
159 * @throws org.exolab.castor.xml.MarshalException if object is
160 * null or if any SAXException is thrown during marshaling
161 * @throws org.exolab.castor.xml.ValidationException if this
162 * object is an invalid instance according to the schema
163 */
164 public void marshal(
165 final java.io.Writer out)
166 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
167 org.exolab.castor.xml.Marshaller.marshal(this, out);
168 }
169
170 /**
171 *
172 *
173 * @param handler
174 * @throws java.io.IOException if an IOException occurs during
175 * marshaling
176 * @throws org.exolab.castor.xml.ValidationException if this
177 * object is an invalid instance according to the schema
178 * @throws org.exolab.castor.xml.MarshalException if object is
179 * null or if any SAXException is thrown during marshaling
180 */
181 public void marshal(
182 final org.xml.sax.ContentHandler handler)
183 throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
184 org.exolab.castor.xml.Marshaller.marshal(this, handler);
185 }
186
187 /**
188 * Sets the value of field 'acceptNull'. The field 'acceptNull'
189 * has the following description: Specifies if this field
190 * accepts NULL
191 * values or not.
192 *
193 *
194 * @param acceptNull the value of field 'acceptNull'.
195 */
196 public void setAcceptNull(
197 final boolean acceptNull) {
198 this._acceptNull = acceptNull;
199 this._has_acceptNull = true;
200 }
201
202 /**
203 * Sets the value of field 'name'. The field 'name' has the
204 * following description: Attribute 'name' is used to specify
205 * the
206 * name of the column.
207 *
208 *
209 * @param name the value of field 'name'.
210 */
211 public void setName(
212 final java.lang.String name) {
213 this._name = name;
214 }
215
216 /**
217 * Sets the value of field 'type'. The field 'type' has the
218 * following description: Attribute 'type' is used to specify
219 * the
220 * JDO-type of the column.
221 *
222 *
223 * @param type the value of field 'type'.
224 */
225 public void setType(
226 final java.lang.String type) {
227 this._type = type;
228 }
229
230 /**
231 * Method unmarshal.
232 *
233 * @param reader
234 * @throws org.exolab.castor.xml.MarshalException if object is
235 * null or if any SAXException is thrown during marshaling
236 * @throws org.exolab.castor.xml.ValidationException if this
237 * object is an invalid instance according to the schema
238 * @return the unmarshaled
239 * org.exolab.castor.xml.schema.annotations.jdo.Column
240 */
241 public static org.exolab.castor.xml.schema.annotations.jdo.Column unmarshal(
242 final java.io.Reader reader)
243 throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException {
244 return (org.exolab.castor.xml.schema.annotations.jdo.Column) org.exolab.castor.xml.Unmarshaller.unmarshal(org.exolab.castor.xml.schema.annotations.jdo.Column.class, reader);
245 }
246
247 /**
248 *
249 *
250 * @throws org.exolab.castor.xml.ValidationException if this
251 * object is an invalid instance according to the schema
252 */
253 public void validate(
254 )
255 throws org.exolab.castor.xml.ValidationException {
256 org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
257 validator.validate(this);
258 }
259
260 }