1
2
3
4
5
6
7
8 package org.exolab.castor.xml.schema.annotations.jdo.descriptors;
9
10
11
12
13
14 import org.exolab.castor.xml.schema.annotations.jdo.PkType;
15
16
17
18
19
20
21 public class PkTypeDescriptor 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 PkTypeDescriptor() {
59 super();
60 _nsURI = "http://www.castor.org/binding/persistence";
61 _xmlName = "pkType";
62 _elementDefinition = false;
63
64
65 setCompositorAsSequence();
66 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
67 org.exolab.castor.mapping.FieldHandler handler = null;
68 org.exolab.castor.xml.FieldValidator fieldValidator = null;
69
70
71
72
73
74 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_keyList", "key", org.exolab.castor.xml.NodeType.Element);
75 desc.setImmutable(true);
76 handler = new org.exolab.castor.xml.XMLFieldHandler() {
77 @Override
78 public java.lang.Object getValue( java.lang.Object object )
79 throws IllegalStateException
80 {
81 PkType target = (PkType) object;
82 return target.getKey();
83 }
84 @Override
85 public void setValue( java.lang.Object object, java.lang.Object value)
86 throws IllegalStateException, IllegalArgumentException
87 {
88 try {
89 PkType target = (PkType) object;
90 target.addKey( (java.lang.String) value);
91 } catch (java.lang.Exception ex) {
92 throw new IllegalStateException(ex.toString());
93 }
94 }
95 public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException {
96 try {
97 PkType target = (PkType) object;
98 target.removeAllKey();
99 } catch (java.lang.Exception ex) {
100 throw new IllegalStateException(ex.toString());
101 }
102 }
103 @Override
104 @SuppressWarnings("unused")
105 public java.lang.Object newInstance(java.lang.Object parent) {
106 return null;
107 }
108 };
109 desc.setSchemaType("list");
110 desc.setComponentType("string");
111 desc.setHandler(handler);
112 desc.setNameSpaceURI("http://www.castor.org/binding/persistence");
113 desc.setRequired(true);
114 desc.setMultivalued(true);
115 addFieldDescriptor(desc);
116 addSequenceElement(desc);
117
118
119 fieldValidator = new org.exolab.castor.xml.FieldValidator();
120 fieldValidator.setMinOccurs(1);
121 {
122 org.exolab.castor.xml.validators.StringValidator typeValidator;
123 typeValidator = new org.exolab.castor.xml.validators.StringValidator();
124 fieldValidator.setValidator(typeValidator);
125 typeValidator.setWhiteSpace("preserve");
126 }
127 desc.setValidator(fieldValidator);
128 }
129
130
131
132
133
134
135
136
137
138
139
140 @Override()
141 public org.exolab.castor.mapping.AccessMode getAccessMode(
142 ) {
143 return null;
144 }
145
146
147
148
149
150
151
152 @Override()
153 public org.exolab.castor.mapping.FieldDescriptor getIdentity(
154 ) {
155 return _identity;
156 }
157
158
159
160
161
162
163 @Override()
164 public java.lang.Class getJavaClass(
165 ) {
166 return org.exolab.castor.xml.schema.annotations.jdo.PkType.class;
167 }
168
169
170
171
172
173
174 @Override()
175 public java.lang.String getNameSpacePrefix(
176 ) {
177 return _nsPrefix;
178 }
179
180
181
182
183
184
185
186 @Override()
187 public java.lang.String getNameSpaceURI(
188 ) {
189 return _nsURI;
190 }
191
192
193
194
195
196
197
198 @Override()
199 public org.exolab.castor.xml.TypeValidator getValidator(
200 ) {
201 return this;
202 }
203
204
205
206
207
208
209 @Override()
210 public java.lang.String getXMLName(
211 ) {
212 return _xmlName;
213 }
214
215
216
217
218
219
220
221
222 public boolean isElementDefinition(
223 ) {
224 return _elementDefinition;
225 }
226
227 }