Public Member Functions | |
CollectionFieldHandler (FieldHandler fieldHandler) | |
CollectionFieldHandler (FieldHandler fieldHandler, TypeValidator validator) | |
void | setValue (Object target, Object value) throws java.lang.IllegalStateException |
Object | getValue (Object target) throws java.lang.IllegalStateException |
void | resetValue (Object target) throws java.lang.IllegalStateException |
void | checkValidity (Object object) throws ValidityException, IllegalStateException |
Object | newInstance (Object parent) throws IllegalStateException |
boolean | equals (Object obj) |
A FieldHandler for the XML Schema Collection type. TODO : support all kind of XSList
org.exolab.castor.xml.handlers.CollectionFieldHandler.CollectionFieldHandler | ( | FieldHandler | fieldHandler | ) |
Creates a new CollectionFieldHandler using the given FieldHandler for delegation.
fieldHandler | the fieldHandler for delegation. |
org.exolab.castor.xml.handlers.CollectionFieldHandler.CollectionFieldHandler | ( | FieldHandler | fieldHandler, | |
TypeValidator | validator | |||
) |
void org.exolab.castor.xml.handlers.CollectionFieldHandler.checkValidity | ( | Object | object | ) | throws ValidityException, IllegalStateException [virtual] |
Checks the field validity. Returns successfully if the field can be stored, is valid, etc, throws an exception otherwise.
object | The object |
ValidityException | The field is invalid, is required and null, or any other validity violation | |
IllegalStateException | The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object |
Reimplemented from org.exolab.castor.mapping.ExtendedFieldHandler.
boolean org.exolab.castor.xml.handlers.CollectionFieldHandler.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.
Reimplemented from org.exolab.castor.xml.XMLFieldHandler.
Object org.exolab.castor.xml.handlers.CollectionFieldHandler.getValue | ( | Object | target | ) | throws java.lang.IllegalStateException [virtual] |
Gets the value of the field associated with this descriptor. If the value is an array, it returns a string 'representing' this array
target | the object in which to set the value | |
value | the value of the field |
Reimplemented from org.exolab.castor.xml.XMLFieldHandler.
References org.exolab.castor.mapping.FieldHandler.getValue().
Object org.exolab.castor.xml.handlers.CollectionFieldHandler.newInstance | ( | Object | parent | ) | throws IllegalStateException [virtual] |
Creates a new instance of the object described by this field.
parent | The object for which the field is created |
IllegalStateException | This field is a simple type and cannot be instantiated |
Reimplemented from org.exolab.castor.xml.XMLFieldHandler.
void org.exolab.castor.xml.handlers.CollectionFieldHandler.resetValue | ( | Object | object | ) | throws java.lang.IllegalStateException [virtual] |
Sets the value of the field to a default value.
Reference fields are set to null, primitive fields are set to their default value, collection fields are emptied of all elements.
object | The object |
IllegalStateException | The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object |
Reimplemented from org.exolab.castor.xml.XMLFieldHandler.
References org.exolab.castor.mapping.FieldHandler.resetValue().
void org.exolab.castor.xml.handlers.CollectionFieldHandler.setValue | ( | Object | target, | |
Object | value | |||
) | throws java.lang.IllegalStateException [virtual] |
Sets the value of the field associated with this descriptor.
target | the object in which to set the value | |
value | the value of the field |
Reimplemented from org.exolab.castor.xml.XMLFieldHandler.
References org.exolab.castor.core.exceptions.CastorException.getMessage(), org.exolab.castor.mapping.FieldHandler.setValue(), and org.exolab.castor.xml.TypeValidator.validate().