|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.xml.handlers.ContainerFieldHandler
public final class ContainerFieldHandler
The FieldHandler for ContainerElement.
org.exolab.castor.mapping.FieldDescriptor,
org.exolab.castor.mapping.FieldHandler| Field Summary | |
|---|---|
static int |
MODE_AUTO
Automatically choose the mode to use. |
static int |
MODE_CHILD_LINK
The mode for a ContainerElement. getValue and setValue operate on the parent. |
static int |
MODE_PARENT_LINK
When the field is not a ContainerElement, this mode is used. |
| Constructor Summary | |
|---|---|
ContainerFieldHandler(FieldHandler handler)
Creates a new ContainerFieldHandler with the given FieldHandler. |
|
| Method Summary | |
|---|---|
void |
checkValidity(Object object)
Checks the field validity. |
Object |
getValue(Object object)
Returns the value of the field from the object. |
Object |
newInstance(Object parent)
Creates a new instance of the object described by this field. |
void |
resetValue(Object object)
Sets the value of the field to a default value. |
void |
setValue(Object object,
Object value)
Sets the value of the field on the object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_AUTO
public static final int MODE_PARENT_LINK
public static final int MODE_CHILD_LINK
| Constructor Detail |
|---|
public ContainerFieldHandler(FieldHandler handler)
handler - The field handler to delegate to.| Method Detail |
|---|
public Object getValue(Object object)
throws IllegalStateException
getValue in interface FieldHandlerobject - The object to get the value of
IllegalStateException - The Java object has changed and is no
longer supported by this handler, or the handler is not
compatible with the Java object
public Object newInstance(Object parent)
throws IllegalStateException
newInstance in interface FieldHandlerparent - The object for which the field is created
IllegalStateException - This field is a simple type and cannot be
instantiated
public void resetValue(Object object)
throws IllegalStateException
Reference fields are set to null, primitive fields are set to their default value, collection fields are emptied of all elements.
resetValue in interface FieldHandlerobject - 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
public void setValue(Object object,
Object value)
throws IllegalStateException,
IllegalArgumentException
setValue in interface FieldHandlerobject - The object whose value to set.value - The new value
IllegalStateException - The Java object has changed and is no
longer supported by this handler, or the handler is not
compatiable with the Java object
IllegalArgumentException - The value passed is not of a supported
type
public void checkValidity(Object object)
throws ValidityException,
IllegalStateException
checkValidity in interface FieldHandlerobject - 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||