public class CollectionFieldHandler extends XMLFieldHandler
TODO : support all kind of XSList.
_properties
Constructor and Description |
---|
CollectionFieldHandler(FieldHandler fieldHandler)
Creates a new CollectionFieldHandler using the given FieldHandler for
delegation.
|
CollectionFieldHandler(FieldHandler fieldHandler,
TypeValidator validator)
Creates a new CollectionFieldHandler using the given FieldHandler for
delegation and the given type validator for validation.
|
Modifier and Type | Method and Description |
---|---|
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.
|
newInstance
getFieldDescriptor, hasValue, setConfiguration, setFieldDescriptor
public CollectionFieldHandler(FieldHandler fieldHandler)
fieldHandler
- the fieldHandler for delegation.public CollectionFieldHandler(FieldHandler fieldHandler, TypeValidator validator)
fieldHandler
- the fieldHandler for delegation.validator
- Type validator to use to validate an instance of this type.public void setValue(Object target, Object value) throws IllegalStateException
setValue
in interface FieldHandler
setValue
in class XMLFieldHandler
target
- the object in which to set the valuevalue
- the value of the fieldIllegalStateException
- if any value provided fails validation.public Object getValue(Object target) throws IllegalStateException
getValue
in interface FieldHandler
getValue
in class XMLFieldHandler
target
- the object from which to get the valueIllegalStateException
- if any value provided fails validation.public void resetValue(Object target) throws IllegalStateException
resetValue
in interface FieldHandler
resetValue
in class XMLFieldHandler
target
- The object to resetIllegalStateException
- if the Java object has changed and is no
longer supported by this handler or the handler is not
compatible with the Java objectpublic void checkValidity(Object object) throws ValidityException, IllegalStateException
checkValidity
in interface FieldHandler
checkValidity
in class ExtendedFieldHandler
object
- The objectValidityException
- The field is invalid, is required and null, or
any other validity violationIllegalStateException
- The Java object has changed and is no
longer supported by this handler, or the handler is not
compatiable with the Java objectpublic Object newInstance(Object parent) throws IllegalStateException
newInstance
in interface FieldHandler
newInstance
in class XMLFieldHandler
parent
- The object for which the field is createdIllegalStateException
- This field is a simple type and cannot be
instantiatedpublic boolean equals(Object obj)
equals
in class XMLFieldHandler
obj
- The object to compare to this
.Copyright © 2014. All rights reserved.