Revision 5346 trunk/frameworks/_fwAndami/src/com/iver/andami/plugins/config/generate/ActionToolDescriptor.java
ActionToolDescriptor.java | ||
---|---|---|
282 | 282 |
} |
283 | 283 |
desc.setValidator(fieldValidator); |
284 | 284 |
//-- _position |
285 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.String.class, "_position", "position", org.exolab.castor.xml.NodeType.Attribute); |
|
286 |
desc.setImmutable(true); |
|
285 |
desc = new org.exolab.castor.xml.util.XMLFieldDescriptorImpl(java.lang.Integer.TYPE, "_position", "position", org.exolab.castor.xml.NodeType.Attribute); |
|
287 | 286 |
handler = (new org.exolab.castor.xml.XMLFieldHandler() { |
288 | 287 |
public java.lang.Object getValue( java.lang.Object object ) |
289 | 288 |
throws IllegalStateException |
290 | 289 |
{ |
291 | 290 |
ActionTool target = (ActionTool) object; |
292 |
return target.getPosition(); |
|
291 |
if(!target.hasPosition()) |
|
292 |
return null; |
|
293 |
return new java.lang.Integer(target.getPosition()); |
|
293 | 294 |
} |
294 | 295 |
public void setValue( java.lang.Object object, java.lang.Object value) |
295 | 296 |
throws IllegalStateException, IllegalArgumentException |
296 | 297 |
{ |
297 | 298 |
try { |
298 | 299 |
ActionTool target = (ActionTool) object; |
299 |
target.setPosition( (java.lang.String) value); |
|
300 |
// if null, use delete method for optional primitives |
|
301 |
if (value == null) { |
|
302 |
target.deletePosition(); |
|
303 |
return; |
|
304 |
} |
|
305 |
target.setPosition( ((java.lang.Integer)value).intValue()); |
|
300 | 306 |
} |
301 | 307 |
catch (java.lang.Exception ex) { |
302 | 308 |
throw new IllegalStateException(ex.toString()); |
... | ... | |
312 | 318 |
//-- validation code for: _position |
313 | 319 |
fieldValidator = new org.exolab.castor.xml.FieldValidator(); |
314 | 320 |
{ //-- local scope |
315 |
StringValidator typeValidator = new StringValidator(); |
|
316 |
typeValidator.setWhiteSpace("preserve"); |
|
321 |
IntegerValidator typeValidator= new IntegerValidator(); |
|
317 | 322 |
fieldValidator.setValidator(typeValidator); |
318 | 323 |
} |
319 | 324 |
desc.setValidator(fieldValidator); |
Also available in: Unified diff