1
2
3
4
5
6
7
8 package org.exolab.castor.tests.framework.testDescriptor.descriptors;
9
10
11
12
13
14 import org.exolab.castor.tests.framework.testDescriptor.FailureType;
15
16
17
18
19
20
21 public class FailureTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
22
23
24
25
26
27
28
29
30
31 private boolean _elementDefinition;
32
33
34
35
36 private java.lang.String _nsPrefix;
37
38
39
40
41 private java.lang.String _nsURI;
42
43
44
45
46 private java.lang.String _xmlName;
47
48
49
50
51 private org.exolab.castor.xml.XMLFieldDescriptor _identity;
52
53
54
55
56
57
58 public FailureTypeDescriptor() {
59 super();
60 _nsURI = "http://castor.exolab.org/Test";
61 _xmlName = "FailureType";
62 _elementDefinition = false;
63 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
64 org.exolab.castor.mapping.FieldHandler handler = null;
65 org.exolab.castor.xml.FieldValidator fieldValidator = null;
66
67 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Boolean.TYPE, "_content", "PCDATA", org.exolab.castor.xml.NodeType.Text);
68 handler = new org.exolab.castor.xml.XMLFieldHandler() {
69 public java.lang.Object getValue( java.lang.Object object )
70 throws IllegalStateException
71 {
72 FailureType target = (FailureType) object;
73 if (!target.hasContent()) { return null; }
74 return (target.getContent() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
75 }
76 public void setValue( java.lang.Object object, java.lang.Object value)
77 throws IllegalStateException, IllegalArgumentException
78 {
79 try {
80 FailureType target = (FailureType) object;
81
82 if (value == null) {
83 target.deleteContent();
84 return;
85 }
86 target.setContent( ((java.lang.Boolean) value).booleanValue());
87 } catch (java.lang.Exception ex) {
88 throw new IllegalStateException(ex.toString());
89 }
90 }
91 public java.lang.Object newInstance(java.lang.Object parent) {
92 return null;
93 }
94 };
95 desc.setSchemaType("boolean");
96 desc.setHandler(handler);
97 addFieldDescriptor(desc);
98
99
100 fieldValidator = new org.exolab.castor.xml.FieldValidator();
101 {
102 org.exolab.castor.xml.validators.BooleanValidator typeValidator;
103 typeValidator = new org.exolab.castor.xml.validators.BooleanValidator();
104 fieldValidator.setValidator(typeValidator);
105 }
106 desc.setValidator(fieldValidator);
107
108
109
110 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_exception", "exception", org.exolab.castor.xml.NodeType.Attribute);
111 desc.setImmutable(true);
112 handler = new org.exolab.castor.xml.XMLFieldHandler() {
113 public java.lang.Object getValue( java.lang.Object object )
114 throws IllegalStateException
115 {
116 FailureType target = (FailureType) object;
117 return target.getException();
118 }
119 public void setValue( java.lang.Object object, java.lang.Object value)
120 throws IllegalStateException, IllegalArgumentException
121 {
122 try {
123 FailureType target = (FailureType) object;
124 target.setException( (java.lang.String) value);
125 } catch (java.lang.Exception ex) {
126 throw new IllegalStateException(ex.toString());
127 }
128 }
129 public java.lang.Object newInstance(java.lang.Object parent) {
130 return null;
131 }
132 };
133 desc.setSchemaType("string");
134 desc.setHandler(handler);
135 desc.setMultivalued(false);
136 addFieldDescriptor(desc);
137
138
139 fieldValidator = new org.exolab.castor.xml.FieldValidator();
140 {
141 org.exolab.castor.xml.validators.StringValidator typeValidator;
142 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
143 fieldValidator.setValidator(typeValidator);
144 typeValidator.setWhiteSpace("preserve");
145 }
146 desc.setValidator(fieldValidator);
147
148 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType.class, "_failureStep", "FailureStep", org.exolab.castor.xml.NodeType.Attribute);
149 handler = new org.exolab.castor.xml.XMLFieldHandler() {
150 public java.lang.Object getValue( java.lang.Object object )
151 throws IllegalStateException
152 {
153 FailureType target = (FailureType) object;
154 return target.getFailureStep();
155 }
156 public void setValue( java.lang.Object object, java.lang.Object value)
157 throws IllegalStateException, IllegalArgumentException
158 {
159 try {
160 FailureType target = (FailureType) object;
161 target.setFailureStep( (org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType) value);
162 } catch (java.lang.Exception ex) {
163 throw new IllegalStateException(ex.toString());
164 }
165 }
166 public java.lang.Object newInstance(java.lang.Object parent) {
167 return null;
168 }
169 };
170 handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType.class, handler);
171 desc.setImmutable(true);
172 desc.setSchemaType("FailureStepType");
173 desc.setHandler(handler);
174 desc.setMultivalued(false);
175 addFieldDescriptor(desc);
176
177
178 fieldValidator = new org.exolab.castor.xml.FieldValidator();
179 {
180 }
181 desc.setValidator(fieldValidator);
182
183
184 }
185
186
187
188
189
190
191
192
193
194
195
196 public org.exolab.castor.mapping.AccessMode getAccessMode(
197 ) {
198 return null;
199 }
200
201
202
203
204
205
206
207 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
208 ) {
209 return _identity;
210 }
211
212
213
214
215
216
217 public java.lang.Class getJavaClass(
218 ) {
219 return org.exolab.castor.tests.framework.testDescriptor.FailureType.class;
220 }
221
222
223
224
225
226
227 public java.lang.String getNameSpacePrefix(
228 ) {
229 return _nsPrefix;
230 }
231
232
233
234
235
236
237
238 public java.lang.String getNameSpaceURI(
239 ) {
240 return _nsURI;
241 }
242
243
244
245
246
247
248
249 public org.exolab.castor.xml.TypeValidator getValidator(
250 ) {
251 return this;
252 }
253
254
255
256
257
258
259 public java.lang.String getXMLName(
260 ) {
261 return _xmlName;
262 }
263
264
265
266
267
268
269
270
271 public boolean isElementDefinition(
272 ) {
273 return _elementDefinition;
274 }
275
276 }