1 /*
2 * This class was automatically generated with
3 * <a href="http://castor.exolab.org">Castor 0.9.4</a>, using an
4 * XML Schema.
5 * $Id$
6 */
7
8 package org.enableit.db.beans;
9
10 //---------------------------------/
11 //- Imported classes and packages -/
12 //---------------------------------/
13
14 import org.exolab.castor.mapping.AccessMode;
15 import org.exolab.castor.mapping.ClassDescriptor;
16 import org.exolab.castor.mapping.FieldDescriptor;
17 import org.exolab.castor.xml.*;
18 import org.exolab.castor.xml.FieldValidator;
19 import org.exolab.castor.xml.TypeValidator;
20 import org.exolab.castor.xml.XMLFieldDescriptor;
21 import org.exolab.castor.xml.handlers.*;
22 import org.exolab.castor.xml.util.XMLFieldDescriptorImpl;
23 import org.exolab.castor.xml.validators.*;
24
25 /***
26 *
27 *
28 * @version $Revision$ $Date$
29 **/
30 public class RowSetDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
31
32
33 //--------------------------/
34 //- Class/Member Variables -/
35 //--------------------------/
36
37 private java.lang.String nsPrefix;
38
39 private java.lang.String nsURI;
40
41 private java.lang.String xmlName;
42
43 private org.exolab.castor.xml.XMLFieldDescriptor identity;
44
45
46 //----------------/
47 //- Constructors -/
48 //----------------/
49
50 public RowSetDescriptor() {
51 super();
52 xmlName = "row-set";
53
54 //-- set grouping compositor
55 setCompositorAsSequence();
56 XMLFieldDescriptorImpl desc = null;
57 XMLFieldHandler handler = null;
58 FieldValidator fieldValidator = null;
59 //-- initialize attribute descriptors
60
61 //-- _table
62 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_table", "table", NodeType.Attribute);
63 desc.setImmutable(true);
64 handler = (new XMLFieldHandler() {
65 public java.lang.Object getValue( java.lang.Object object )
66 throws IllegalStateException
67 {
68 RowSet target = (RowSet) object;
69 return target.getTable();
70 }
71 public void setValue( java.lang.Object object, java.lang.Object value)
72 throws IllegalStateException, IllegalArgumentException
73 {
74 try {
75 RowSet target = (RowSet) object;
76 target.setTable( (java.lang.String) value);
77 }
78 catch (Exception ex) {
79 throw new IllegalStateException(ex.toString());
80 }
81 }
82 public java.lang.Object newInstance( java.lang.Object parent ) {
83 return null;
84 }
85 } );
86 desc.setHandler(handler);
87 desc.setRequired(true);
88 addFieldDescriptor(desc);
89
90 //-- validation code for: _table
91 fieldValidator = new FieldValidator();
92 fieldValidator.setMinOccurs(1);
93 { //-- local scope
94 StringValidator typeValidator = new StringValidator();
95 typeValidator.setWhiteSpace("preserve");
96 fieldValidator.setValidator(typeValidator);
97 }
98 desc.setValidator(fieldValidator);
99 //-- _truncateFirst
100 desc = new XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_truncateFirst", "truncate-first", NodeType.Attribute);
101 handler = (new XMLFieldHandler() {
102 public java.lang.Object getValue( java.lang.Object object )
103 throws IllegalStateException
104 {
105 RowSet target = (RowSet) object;
106 if(!target.hasTruncateFirst())
107 return null;
108 return new Boolean(target.getTruncateFirst());
109 }
110 public void setValue( java.lang.Object object, java.lang.Object value)
111 throws IllegalStateException, IllegalArgumentException
112 {
113 try {
114 RowSet target = (RowSet) object;
115 // if null, use delete method for optional primitives
116 if (value == null) {
117 target.deleteTruncateFirst();
118 return;
119 }
120 target.setTruncateFirst( ((Boolean)value).booleanValue());
121 }
122 catch (Exception ex) {
123 throw new IllegalStateException(ex.toString());
124 }
125 }
126 public java.lang.Object newInstance( java.lang.Object parent ) {
127 return null;
128 }
129 } );
130 desc.setHandler(handler);
131 addFieldDescriptor(desc);
132
133 //-- validation code for: _truncateFirst
134 fieldValidator = new FieldValidator();
135 { //-- local scope
136 BooleanValidator typeValidator = new BooleanValidator();
137 fieldValidator.setValidator(typeValidator);
138 }
139 desc.setValidator(fieldValidator);
140 //-- initialize element descriptors
141
142 //-- _conflictResolverList
143 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_conflictResolverList", "conflict-resolver", NodeType.Element);
144 desc.setImmutable(true);
145 handler = (new XMLFieldHandler() {
146 public java.lang.Object getValue( java.lang.Object object )
147 throws IllegalStateException
148 {
149 RowSet target = (RowSet) object;
150 return target.getConflictResolver();
151 }
152 public void setValue( java.lang.Object object, java.lang.Object value)
153 throws IllegalStateException, IllegalArgumentException
154 {
155 try {
156 RowSet target = (RowSet) object;
157 target.addConflictResolver( (java.lang.String) value);
158 }
159 catch (Exception ex) {
160 throw new IllegalStateException(ex.toString());
161 }
162 }
163 public java.lang.Object newInstance( java.lang.Object parent ) {
164 return null;
165 }
166 } );
167 desc.setHandler(handler);
168 desc.setMultivalued(true);
169 addFieldDescriptor(desc);
170
171 //-- validation code for: _conflictResolverList
172 fieldValidator = new FieldValidator();
173 fieldValidator.setMinOccurs(0);
174 { //-- local scope
175 StringValidator typeValidator = new StringValidator();
176 typeValidator.setWhiteSpace("preserve");
177 fieldValidator.setValidator(typeValidator);
178 }
179 desc.setValidator(fieldValidator);
180 //-- _rowList
181 desc = new XMLFieldDescriptorImpl(Row.class, "_rowList", "row", NodeType.Element);
182 handler = (new XMLFieldHandler() {
183 public java.lang.Object getValue( java.lang.Object object )
184 throws IllegalStateException
185 {
186 RowSet target = (RowSet) object;
187 return target.getRow();
188 }
189 public void setValue( java.lang.Object object, java.lang.Object value)
190 throws IllegalStateException, IllegalArgumentException
191 {
192 try {
193 RowSet target = (RowSet) object;
194 target.addRow( (Row) value);
195 }
196 catch (Exception ex) {
197 throw new IllegalStateException(ex.toString());
198 }
199 }
200 public java.lang.Object newInstance( java.lang.Object parent ) {
201 return new Row();
202 }
203 } );
204 desc.setHandler(handler);
205 desc.setMultivalued(true);
206 addFieldDescriptor(desc);
207
208 //-- validation code for: _rowList
209 fieldValidator = new FieldValidator();
210 fieldValidator.setMinOccurs(0);
211 { //-- local scope
212 }
213 desc.setValidator(fieldValidator);
214 } //-- org.enableit.db.beans.RowSetDescriptor()
215
216
217 //-----------/
218 //- Methods -/
219 //-----------/
220
221 /***
222 **/
223 public org.exolab.castor.mapping.AccessMode getAccessMode()
224 {
225 return null;
226 } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
227
228 /***
229 **/
230 public org.exolab.castor.mapping.ClassDescriptor getExtends()
231 {
232 return null;
233 } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
234
235 /***
236 **/
237 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
238 {
239 return identity;
240 } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
241
242 /***
243 **/
244 public java.lang.Class getJavaClass()
245 {
246 return org.enableit.db.beans.RowSet.class;
247 } //-- java.lang.Class getJavaClass()
248
249 /***
250 **/
251 public java.lang.String getNameSpacePrefix()
252 {
253 return nsPrefix;
254 } //-- java.lang.String getNameSpacePrefix()
255
256 /***
257 **/
258 public java.lang.String getNameSpaceURI()
259 {
260 return nsURI;
261 } //-- java.lang.String getNameSpaceURI()
262
263 /***
264 **/
265 public org.exolab.castor.xml.TypeValidator getValidator()
266 {
267 return this;
268 } //-- org.exolab.castor.xml.TypeValidator getValidator()
269
270 /***
271 **/
272 public java.lang.String getXMLName()
273 {
274 return xmlName;
275 } //-- java.lang.String getXMLName()
276
277 }
This page was automatically generated by Maven