1
2
3
4
5
6
7
8 package fr.in2p3.jsaga.adaptor.schema.job.emulator.config;
9
10
11
12
13
14 import org.exolab.castor.mapping.AccessMode;
15 import org.exolab.castor.xml.TypeValidator;
16 import org.exolab.castor.xml.XMLFieldDescriptor;
17 import org.exolab.castor.xml.validators.*;
18
19
20
21
22
23
24 public class DelayTypeDescriptor extends org.exolab.castor.xml.util.XMLClassDescriptorImpl {
25
26
27
28
29
30
31
32
33
34 private java.lang.String nsPrefix;
35
36
37
38
39 private java.lang.String nsURI;
40
41
42
43
44 private java.lang.String xmlName;
45
46
47
48
49 private org.exolab.castor.xml.XMLFieldDescriptor identity;
50
51
52
53
54
55
56 public DelayTypeDescriptor()
57 {
58 super();
59 nsURI = "http://www.in2p3.fr/jsaga/job-emulator-config";
60 xmlName = "DelayType";
61 org.exolab.castor.xml.util.XMLFieldDescriptorImpl desc = null;
62 org.exolab.castor.mapping.FieldHandler handler = null;
63 org.exolab.castor.xml.FieldValidator fieldValidator = null;
64
65
66
67 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(org.exolab.castor.types.Duration.class, "_time", "time", org.exolab.castor.xml.NodeType.Attribute);
68 handler = new org.exolab.castor.xml.XMLFieldHandler() {
69 public java.lang.Object getValue( java.lang.Object object )
70 throws IllegalStateException
71 {
72 DelayType target = (DelayType) object;
73 return target.getTime();
74 }
75 public void setValue( java.lang.Object object, java.lang.Object value)
76 throws IllegalStateException, IllegalArgumentException
77 {
78 try {
79 DelayType target = (DelayType) object;
80 target.setTime( (org.exolab.castor.types.Duration.parseDuration((String) value)));
81 }
82 catch (java.lang.Exception ex) {
83 throw new IllegalStateException(ex.toString());
84 }
85 }
86 public java.lang.Object newInstance( java.lang.Object parent ) {
87 return new org.exolab.castor.types.Duration();
88 }
89 };
90 desc.setHandler(handler);
91 desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
92 desc.setRequired(true);
93 desc.setMultivalued(false);
94 addFieldDescriptor(desc);
95
96
97 fieldValidator = new org.exolab.castor.xml.FieldValidator();
98 fieldValidator.setMinOccurs(1);
99 {
100 DurationValidator typeValidator = new DurationValidator();
101 fieldValidator.setValidator(typeValidator);
102 }
103 desc.setValidator(fieldValidator);
104
105 desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(float.class, "_percent", "percent", org.exolab.castor.xml.NodeType.Attribute);
106 handler = new org.exolab.castor.xml.XMLFieldHandler() {
107 public java.lang.Object getValue( java.lang.Object object )
108 throws IllegalStateException
109 {
110 DelayType target = (DelayType) object;
111 if(!target.hasPercent())
112 return null;
113 return new java.lang.Float(target.getPercent());
114 }
115 public void setValue( java.lang.Object object, java.lang.Object value)
116 throws IllegalStateException, IllegalArgumentException
117 {
118 try {
119 DelayType target = (DelayType) object;
120
121 if (value == null) return;
122
123 target.setPercent( ((java.lang.Float)value).floatValue());
124 }
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.setHandler(handler);
134 desc.setNameSpaceURI("http://www.in2p3.fr/jsaga/job-emulator-config");
135 desc.setRequired(true);
136 desc.setMultivalued(false);
137 addFieldDescriptor(desc);
138
139
140 fieldValidator = new org.exolab.castor.xml.FieldValidator();
141 fieldValidator.setMinOccurs(1);
142 {
143 FloatValidator typeValidator = new FloatValidator();
144 typeValidator.setMinInclusive(0.0f);
145 typeValidator.setMaxInclusive(1.0f);
146 fieldValidator.setValidator(typeValidator);
147 }
148 desc.setValidator(fieldValidator);
149
150
151 }
152
153
154
155
156
157
158
159
160
161
162
163
164
165 public org.exolab.castor.mapping.AccessMode getAccessMode()
166 {
167 return null;
168 }
169
170
171
172
173
174
175
176
177 public org.exolab.castor.mapping.ClassDescriptor getExtends()
178 {
179 return null;
180 }
181
182
183
184
185
186
187
188
189 public org.exolab.castor.mapping.FieldDescriptor getIdentity()
190 {
191 return identity;
192 }
193
194
195
196
197
198
199
200
201 public java.lang.Class getJavaClass()
202 {
203 return fr.in2p3.jsaga.adaptor.schema.job.emulator.config.DelayType.class;
204 }
205
206
207
208
209
210
211
212
213 public java.lang.String getNameSpacePrefix()
214 {
215 return nsPrefix;
216 }
217
218
219
220
221
222
223
224
225 public java.lang.String getNameSpaceURI()
226 {
227 return nsURI;
228 }
229
230
231
232
233
234
235
236
237 public org.exolab.castor.xml.TypeValidator getValidator()
238 {
239 return this;
240 }
241
242
243
244
245
246
247
248
249 public java.lang.String getXMLName()
250 {
251 return xmlName;
252 }
253
254 }