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 SchemaDescriptor 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 SchemaDescriptor() {
51 super();
52 nsURI = "http://darrt.sourceforge.net/schemas/darrt";
53 xmlName = "schema";
54
55 //-- set grouping compositor
56 setCompositorAsSequence();
57 XMLFieldDescriptorImpl desc = null;
58 XMLFieldHandler handler = null;
59 FieldValidator fieldValidator = null;
60 //-- initialize attribute descriptors
61
62 //-- initialize element descriptors
63
64 //-- _name
65 desc = new XMLFieldDescriptorImpl(java.lang.String.class, "_name", "name", NodeType.Element);
66 desc.setImmutable(true);
67 handler = (new XMLFieldHandler() {
68 public java.lang.Object getValue( java.lang.Object object )
69 throws IllegalStateException
70 {
71 Schema target = (Schema) object;
72 return target.getName();
73 }
74 public void setValue( java.lang.Object object, java.lang.Object value)
75 throws IllegalStateException, IllegalArgumentException
76 {
77 try {
78 Schema target = (Schema) object;
79 target.setName( (java.lang.String) value);
80 }
81 catch (Exception ex) {
82 throw new IllegalStateException(ex.toString());
83 }
84 }
85 public java.lang.Object newInstance( java.lang.Object parent ) {
86 return null;
87 }
88 } );
89 desc.setHandler(handler);
90 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt");
91 desc.setRequired(true);
92 desc.setMultivalued(false);
93 addFieldDescriptor(desc);
94
95 //-- validation code for: _name
96 fieldValidator = new FieldValidator();
97 fieldValidator.setMinOccurs(1);
98 { //-- local scope
99 StringValidator typeValidator = new StringValidator();
100 typeValidator.setWhiteSpace("preserve");
101 fieldValidator.setValidator(typeValidator);
102 }
103 desc.setValidator(fieldValidator);
104 //-- _tableList
105 desc = new XMLFieldDescriptorImpl(Table.class, "_tableList", "table", NodeType.Element);
106 handler = (new XMLFieldHandler() {
107 public java.lang.Object getValue( java.lang.Object object )
108 throws IllegalStateException
109 {
110 Schema target = (Schema) object;
111 return target.getTable();
112 }
113 public void setValue( java.lang.Object object, java.lang.Object value)
114 throws IllegalStateException, IllegalArgumentException
115 {
116 try {
117 Schema target = (Schema) object;
118 target.addTable( (Table) value);
119 }
120 catch (Exception ex) {
121 throw new IllegalStateException(ex.toString());
122 }
123 }
124 public java.lang.Object newInstance( java.lang.Object parent ) {
125 return new Table();
126 }
127 } );
128 desc.setHandler(handler);
129 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt");
130 desc.setMultivalued(true);
131 addFieldDescriptor(desc);
132
133 //-- validation code for: _tableList
134 fieldValidator = new FieldValidator();
135 fieldValidator.setMinOccurs(0);
136 { //-- local scope
137 }
138 desc.setValidator(fieldValidator);
139 //-- _viewList
140 desc = new XMLFieldDescriptorImpl(View.class, "_viewList", "view", NodeType.Element);
141 handler = (new XMLFieldHandler() {
142 public java.lang.Object getValue( java.lang.Object object )
143 throws IllegalStateException
144 {
145 Schema target = (Schema) object;
146 return target.getView();
147 }
148 public void setValue( java.lang.Object object, java.lang.Object value)
149 throws IllegalStateException, IllegalArgumentException
150 {
151 try {
152 Schema target = (Schema) object;
153 target.addView( (View) value);
154 }
155 catch (Exception ex) {
156 throw new IllegalStateException(ex.toString());
157 }
158 }
159 public java.lang.Object newInstance( java.lang.Object parent ) {
160 return new View();
161 }
162 } );
163 desc.setHandler(handler);
164 desc.setNameSpaceURI("http://darrt.sourceforge.net/schemas/darrt");
165 desc.setMultivalued(true);
166 addFieldDescriptor(desc);
167
168 //-- validation code for: _viewList
169 fieldValidator = new FieldValidator();
170 fieldValidator.setMinOccurs(0);
171 { //-- local scope
172 }
173 desc.setValidator(fieldValidator);
174 } //-- org.enableit.db.beans.SchemaDescriptor()
175
176
177 //-----------/
178 //- Methods -/
179 //-----------/
180
181 /***
182 **/
183 public org.exolab.castor.mapping.AccessMode getAccessMode()
184 {
185 return null;
186 } //-- org.exolab.castor.mapping.AccessMode getAccessMode()
187
188 /***
189 **/
190 public org.exolab.castor.mapping.ClassDescriptor getExtends()
191 {
192 return null;
193 } //-- org.exolab.castor.mapping.ClassDescriptor getExtends()
194
195 /***
196 **/
197 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
198 {
199 return identity;
200 } //-- org.exolab.castor.mapping.FieldDescriptor getIdentity()
201
202 /***
203 **/
204 public java.lang.Class getJavaClass()
205 {
206 return org.enableit.db.beans.Schema.class;
207 } //-- java.lang.Class getJavaClass()
208
209 /***
210 **/
211 public java.lang.String getNameSpacePrefix()
212 {
213 return nsPrefix;
214 } //-- java.lang.String getNameSpacePrefix()
215
216 /***
217 **/
218 public java.lang.String getNameSpaceURI()
219 {
220 return nsURI;
221 } //-- java.lang.String getNameSpaceURI()
222
223 /***
224 **/
225 public org.exolab.castor.xml.TypeValidator getValidator()
226 {
227 return this;
228 } //-- org.exolab.castor.xml.TypeValidator getValidator()
229
230 /***
231 **/
232 public java.lang.String getXMLName()
233 {
234 return xmlName;
235 } //-- java.lang.String getXMLName()
236
237 }
This page was automatically generated by Maven