1
2
3
4
5
6
7
8 package org.exolab.castor.mapping.xml.descriptors;
9
10
11
12
13
14 import org.exolab.castor.mapping.xml.ClassChoice;
15
16
17
18
19
20
21 public class ClassChoiceDescriptor 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 ClassChoiceDescriptor() {
59 super();
60 _nsURI = "http://castor.exolab.org/";
61 _elementDefinition = false;
62
63
64 setCompositorAsChoice();
65 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
66 org.exolab.castor.mapping.FieldHandler handler = null;
67 org.exolab.castor.xml.FieldValidator fieldValidator = null;
68
69
70
71
72
73 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.mapping.xml.FieldMapping.class, "_fieldMappingList", "field", org.exolab.castor.xml.NodeType.Element);
74 handler = new org.exolab.castor.xml.XMLFieldHandler() {
75 @Override
76 public java.lang.Object getValue( java.lang.Object object )
77 throws IllegalStateException
78 {
79 ClassChoice target = (ClassChoice) object;
80 return target.getFieldMapping();
81 }
82 @Override
83 public void setValue( java.lang.Object object, java.lang.Object value)
84 throws IllegalStateException, IllegalArgumentException
85 {
86 try {
87 ClassChoice target = (ClassChoice) object;
88 target.addFieldMapping( (org.exolab.castor.mapping.xml.FieldMapping) value);
89 } catch (java.lang.Exception ex) {
90 throw new IllegalStateException(ex.toString());
91 }
92 }
93 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
94 try {
95 ClassChoice target = (ClassChoice) object;
96 target.removeAllFieldMapping();
97 } catch (java.lang.Exception ex) {
98 throw new IllegalStateException(ex.toString());
99 }
100 }
101 @Override
102 @SuppressWarnings("unused")
103 public java.lang.Object newInstance(java.lang.Object parent) {
104 return null;
105 }
106 };
107 desc.setSchemaType("list");
108 desc.setComponentType("org.exolab.castor.mapping.xml.FieldMapping");
109 desc.setHandler(handler);
110 desc.setNameSpaceURI("http://castor.exolab.org/");
111 desc.setMultivalued(true);
112 addFieldDescriptor(desc);
113 addSequenceElement(desc);
114
115
116 fieldValidator = new org.exolab.castor.xml.FieldValidator();
117 fieldValidator.setMinOccurs(0);
118 {
119 }
120 desc.setValidator(fieldValidator);
121
122 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.mapping.xml.Container.class, "_containerList", "container", org.exolab.castor.xml.NodeType.Element);
123 handler = new org.exolab.castor.xml.XMLFieldHandler() {
124 @Override
125 public java.lang.Object getValue( java.lang.Object object )
126 throws IllegalStateException
127 {
128 ClassChoice target = (ClassChoice) object;
129 return target.getContainer();
130 }
131 @Override
132 public void setValue( java.lang.Object object, java.lang.Object value)
133 throws IllegalStateException, IllegalArgumentException
134 {
135 try {
136 ClassChoice target = (ClassChoice) object;
137 target.addContainer( (org.exolab.castor.mapping.xml.Container) value);
138 } catch (java.lang.Exception ex) {
139 throw new IllegalStateException(ex.toString());
140 }
141 }
142 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
143 try {
144 ClassChoice target = (ClassChoice) object;
145 target.removeAllContainer();
146 } catch (java.lang.Exception ex) {
147 throw new IllegalStateException(ex.toString());
148 }
149 }
150 @Override
151 @SuppressWarnings("unused")
152 public java.lang.Object newInstance(java.lang.Object parent) {
153 return null;
154 }
155 };
156 desc.setSchemaType("list");
157 desc.setComponentType("org.exolab.castor.mapping.xml.Container");
158 desc.setHandler(handler);
159 desc.setNameSpaceURI("http://castor.exolab.org/");
160 desc.setMultivalued(true);
161 addFieldDescriptor(desc);
162 addSequenceElement(desc);
163
164
165 fieldValidator = new org.exolab.castor.xml.FieldValidator();
166 fieldValidator.setMinOccurs(0);
167 {
168 }
169 desc.setValidator(fieldValidator);
170 }
171
172
173
174
175
176
177
178
179
180
181
182 @Override()
183 public org.exolab.castor.mapping.AccessMode getAccessMode(
184 ) {
185 return null;
186 }
187
188
189
190
191
192
193
194 @Override()
195 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
196 ) {
197 return _identity;
198 }
199
200
201
202
203
204
205 @Override()
206 public java.lang.Class getJavaClass(
207 ) {
208 return org.exolab.castor.mapping.xml.ClassChoice.class;
209 }
210
211
212
213
214
215
216 @Override()
217 public java.lang.String getNameSpacePrefix(
218 ) {
219 return _nsPrefix;
220 }
221
222
223
224
225
226
227
228 @Override()
229 public java.lang.String getNameSpaceURI(
230 ) {
231 return _nsURI;
232 }
233
234
235
236
237
238
239
240 @Override()
241 public org.exolab.castor.xml.TypeValidator getValidator(
242 ) {
243 return this;
244 }
245
246
247
248
249
250
251 @Override()
252 public java.lang.String getXMLName(
253 ) {
254 return _xmlName;
255 }
256
257
258
259
260
261
262
263
264 public boolean isElementDefinition(
265 ) {
266 return _elementDefinition;
267 }
268
269 }