org.exolab.castor.xml.handlers
Class CollectionFieldHandler
- ConfigurableFieldHandler, FieldHandler
public class CollectionFieldHandler
A FieldHandler for the XML Schema Collection type.
TODO : support all kind of XSList.
$Revision: 6671 $ $Date: 2003-03-03 00:05:44 -0700 (Mon, 03 Mar
2003) $
void | checkValidity(Object object) - Checks the field validity.
|
boolean | equals(Object obj) - Returns true if the given object is an XMLFieldHandler that is equivalent
to the delegated handler.
|
Object | getValue(Object target) - Gets the value of the field associated with this descriptor.
|
Object | newInstance(Object parent) - Creates a new instance of the object described by this field.
|
void | resetValue(Object target) - Sets the value of the field to a default value.
|
void | setValue(Object target, Object value) - Sets the value of the field associated with this descriptor.
|
CollectionFieldHandler
public CollectionFieldHandler(FieldHandler fieldHandler)
Creates a new CollectionFieldHandler using the given FieldHandler for
delegation.
fieldHandler
- the fieldHandler for delegation.
CollectionFieldHandler
public CollectionFieldHandler(FieldHandler fieldHandler,
TypeValidator validator)
Creates a new CollectionFieldHandler using the given FieldHandler for
delegation and the given type validator for validation.
fieldHandler
- the fieldHandler for delegation.validator
- Type validator to use to validate an instance of this type.
equals
public boolean equals(Object obj)
Returns true if the given object is an XMLFieldHandler that is equivalent
to the delegated handler. An equivalent XMLFieldHandler is an
XMLFieldHandler that is an instances of the same class.
- equals in interface XMLFieldHandler
obj
- The object to compare to this
.
- true if the given object is an XMLFieldHandler that is equivalent
to this one.
getValue
public Object getValue(Object target)
throws java.lang.IllegalStateException
Gets the value of the field associated with this descriptor. If the value
is an array, it returns a string 'representing' this array
- getValue in interface FieldHandler
- getValue in interface XMLFieldHandler
target
- the object from which to get the value
- the value of the field associated with this descriptor.
newInstance
public Object newInstance(Object parent)
throws IllegalStateException
Creates a new instance of the object described by this field.
- newInstance in interface FieldHandler
- newInstance in interface XMLFieldHandler
parent
- The object for which the field is created
- A new instance of the field's value
resetValue
public void resetValue(Object target)
throws java.lang.IllegalStateException
Sets the value of the field to a default value.
- resetValue in interface FieldHandler
- resetValue in interface XMLFieldHandler
target
- The object to reset
setValue
public void setValue(Object target,
Object value)
throws java.lang.IllegalStateException
Sets the value of the field associated with this descriptor. If paased a
String, then String is tokenized and each token is added as an individual
instance to the collection.
- setValue in interface FieldHandler
- setValue in interface XMLFieldHandler
target
- the object in which to set the valuevalue
- the value of the field
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com