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.SchemaDifferencesType;
15
16
17
18
19
20
21 public class SchemaDifferencesTypeDescriptor 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 SchemaDifferencesTypeDescriptor() {
59 super();
60 _nsURI = "http://castor.exolab.org/Test";
61 _xmlName = "SchemaDifferencesType";
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.Integer.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 SchemaDifferencesType target = (SchemaDifferencesType) object;
73 if (!target.hasContent()) { return null; }
74 return new java.lang.Integer(target.getContent());
75 }
76 public void setValue( java.lang.Object object, java.lang.Object value)
77 throws IllegalStateException, IllegalArgumentException
78 {
79 try {
80 SchemaDifferencesType target = (SchemaDifferencesType) object;
81
82 if (value == null) {
83 target.deleteContent();
84 return;
85 }
86 target.setContent( ((java.lang.Integer) value).intValue());
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("int");
96 desc.setHandler(handler);
97 addFieldDescriptor(desc);
98
99
100 fieldValidator = new org.exolab.castor.xml.FieldValidator();
101 {
102 org.exolab.castor.xml.validators.IntValidator typeValidator;
103 typeValidator = new org.exolab.castor.xml.validators.IntValidator();
104 fieldValidator.setValidator(typeValidator);
105 typeValidator.setMinInclusive(-2147483648);
106 typeValidator.setMaxInclusive(2147483647);
107 }
108 desc.setValidator(fieldValidator);
109
110
111
112 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);
113 handler = new org.exolab.castor.xml.XMLFieldHandler() {
114 public java.lang.Object getValue( java.lang.Object object )
115 throws IllegalStateException
116 {
117 SchemaDifferencesType target = (SchemaDifferencesType) object;
118 return target.getFailureStep();
119 }
120 public void setValue( java.lang.Object object, java.lang.Object value)
121 throws IllegalStateException, IllegalArgumentException
122 {
123 try {
124 SchemaDifferencesType target = (SchemaDifferencesType) object;
125 target.setFailureStep( (org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType) value);
126 } catch (java.lang.Exception ex) {
127 throw new IllegalStateException(ex.toString());
128 }
129 }
130 public java.lang.Object newInstance(java.lang.Object parent) {
131 return null;
132 }
133 };
134 handler = new org.exolab.castor.xml.handlers.EnumFieldHandler(org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType.class, handler);
135 desc.setImmutable(true);
136 desc.setSchemaType("FailureStepType");
137 desc.setHandler(handler);
138 desc.setRequired(true);
139 desc.setMultivalued(false);
140 addFieldDescriptor(desc);
141
142
143 fieldValidator = new org.exolab.castor.xml.FieldValidator();
144 fieldValidator.setMinOccurs(1);
145 {
146 }
147 desc.setValidator(fieldValidator);
148
149
150 }
151
152
153
154
155
156
157
158
159
160
161
162 public org.exolab.castor.mapping.AccessMode getAccessMode(
163 ) {
164 return null;
165 }
166
167
168
169
170
171
172
173 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
174 ) {
175 return _identity;
176 }
177
178
179
180
181
182
183 public java.lang.Class getJavaClass(
184 ) {
185 return org.exolab.castor.tests.framework.testDescriptor.SchemaDifferencesType.class;
186 }
187
188
189
190
191
192
193 public java.lang.String getNameSpacePrefix(
194 ) {
195 return _nsPrefix;
196 }
197
198
199
200
201
202
203
204 public java.lang.String getNameSpaceURI(
205 ) {
206 return _nsURI;
207 }
208
209
210
211
212
213
214
215 public org.exolab.castor.xml.TypeValidator getValidator(
216 ) {
217 return this;
218 }
219
220
221
222
223
224
225 public java.lang.String getXMLName(
226 ) {
227 return _xmlName;
228 }
229
230
231
232
233
234
235
236
237 public boolean isElementDefinition(
238 ) {
239 return _elementDefinition;
240 }
241
242 }