|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.mapping.loader.FieldHandlerFriend
org.exolab.castor.mapping.ExtendedFieldHandler
org.exolab.castor.mapping.AbstractFieldHandler
org.exolab.castor.xml.XMLFieldHandler
org.exolab.castor.xml.handlers.CollectionFieldHandler
public class CollectionFieldHandler
A FieldHandler for the XML Schema Collection type.
TODO : support all kind of XSList.
Field Summary |
---|
Fields inherited from class org.exolab.castor.mapping.AbstractFieldHandler |
---|
configuration |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
void |
checkValidity(java.lang.Object object)
Checks the field validity. |
boolean |
equals(java.lang.Object obj)
Returns true if the given object is an XMLFieldHandler that is equivalent to the delegated handler. |
java.lang.Object |
getValue(java.lang.Object target)
Gets the value of the field associated with this descriptor. |
java.lang.Object |
newInstance(java.lang.Object parent)
Creates a new instance of the object described by this field. |
void |
resetValue(java.lang.Object target)
Sets the value of the field to a default value. |
void |
setValue(java.lang.Object target,
java.lang.Object value)
Sets the value of the field associated with this descriptor. |
Methods inherited from class org.exolab.castor.xml.XMLFieldHandler |
---|
newInstance |
Methods inherited from class org.exolab.castor.mapping.AbstractFieldHandler |
---|
getFieldDescriptor, hasValue, setConfiguration, setFieldDescriptor |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
public void setValue(java.lang.Object target, java.lang.Object value) throws java.lang.IllegalStateException
setValue
in interface FieldHandler
setValue
in class XMLFieldHandler
target
- the object in which to set the valuevalue
- the value of the field
java.lang.IllegalStateException
- if any value provided fails validation.public java.lang.Object getValue(java.lang.Object target) throws java.lang.IllegalStateException
getValue
in interface FieldHandler
getValue
in class XMLFieldHandler
target
- the object from which to get the value
java.lang.IllegalStateException
- if any value provided fails validation.public void resetValue(java.lang.Object target) throws java.lang.IllegalStateException
resetValue
in interface FieldHandler
resetValue
in class XMLFieldHandler
target
- The object to reset
java.lang.IllegalStateException
- 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(java.lang.Object object) throws ValidityException, java.lang.IllegalStateException
checkValidity
in interface FieldHandler
checkValidity
in class ExtendedFieldHandler
object
- The object
ValidityException
- The field is invalid, is required and null, or
any other validity violation
java.lang.IllegalStateException
- The Java object has changed and is no
longer supported by this handler, or the handler is not
compatiable with the Java objectpublic java.lang.Object newInstance(java.lang.Object parent) throws java.lang.IllegalStateException
newInstance
in interface FieldHandler
newInstance
in class XMLFieldHandler
parent
- The object for which the field is created
java.lang.IllegalStateException
- This field is a simple type and cannot be
instantiatedpublic boolean equals(java.lang.Object obj)
equals
in class XMLFieldHandler
obj
- The object to compare to this
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |