Public Member Functions | Static Public Attributes

org.exolab.castor.xml.handlers.ContainerFieldHandler Class Reference

Inheritance diagram for org.exolab.castor.xml.handlers.ContainerFieldHandler:
org.exolab.castor.mapping.FieldHandler

List of all members.

Public Member Functions

 ContainerFieldHandler (FieldHandler handler)
final Object getValue (Object object) throws IllegalStateException
Object newInstance (Object parent) throws IllegalStateException
final void resetValue (Object object) throws IllegalStateException, IllegalArgumentException
final void setValue (Object object, Object value) throws IllegalStateException, IllegalArgumentException
void checkValidity (Object object) throws ValidityException, IllegalStateException

Static Public Attributes

static final int MODE_AUTO = 0
static final int MODE_PARENT_LINK = 1
static final int MODE_CHILD_LINK = 2

Detailed Description

The FieldHandler for ContainerElement

Author:
Keith Visco
Version:
Revision:
1.1.1.1
Date:
2003/03/03 07:09:27
See also:
FieldDescriptor
FieldHandler

Constructor & Destructor Documentation

org.exolab.castor.xml.handlers.ContainerFieldHandler.ContainerFieldHandler ( FieldHandler  handler  ) 

Creates a new ContainerFieldHandler with the given FieldHandler.


Member Function Documentation

void org.exolab.castor.xml.handlers.ContainerFieldHandler.checkValidity ( Object  object  )  throws ValidityException, IllegalStateException

Checks the field validity. Returns successfully if the field can be stored, is valid, etc, throws an exception otherwise.

Parameters:
object The object
Exceptions:
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

Implements org.exolab.castor.mapping.FieldHandler.

final Object org.exolab.castor.xml.handlers.ContainerFieldHandler.getValue ( Object  object  )  throws IllegalStateException

Returns the value of the field from the object.

Parameters:
object The object
Returns:
The value of the field
Exceptions:
IllegalStateException The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object

Implements org.exolab.castor.mapping.FieldHandler.

References org.exolab.castor.xml.util.ContainerElement.getParent(), org.exolab.castor.mapping.FieldHandler.getValue(), org.exolab.castor.xml.handlers.ContainerFieldHandler.MODE_AUTO, org.exolab.castor.xml.handlers.ContainerFieldHandler.MODE_CHILD_LINK, org.exolab.castor.xml.handlers.ContainerFieldHandler.MODE_PARENT_LINK, and org.exolab.castor.xml.util.ContainerElement.setParent().

Object org.exolab.castor.xml.handlers.ContainerFieldHandler.newInstance ( Object  parent  )  throws IllegalStateException

Creates a new instance of the object described by this field.

Parameters:
parent The object for which the field is created
Returns:
A new instance of the field's value
Exceptions:
IllegalStateException This field is a simple type and cannot be instantiated

Implements org.exolab.castor.mapping.FieldHandler.

References org.exolab.castor.xml.util.ContainerElement.getParent(), org.exolab.castor.mapping.FieldHandler.newInstance(), and org.exolab.castor.xml.util.ContainerElement.setParent().

final void org.exolab.castor.xml.handlers.ContainerFieldHandler.resetValue ( Object  object  )  throws IllegalStateException, IllegalArgumentException

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.

Parameters:
object The object
Exceptions:
IllegalStateException The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object

Implements org.exolab.castor.mapping.FieldHandler.

References org.exolab.castor.mapping.FieldHandler.resetValue().

final void org.exolab.castor.xml.handlers.ContainerFieldHandler.setValue ( Object  object,
Object  value 
) throws IllegalStateException, IllegalArgumentException

Sets the value of the field on the object.

Parameters:
object The object
value The new value
Exceptions:
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

Implements org.exolab.castor.mapping.FieldHandler.

References org.exolab.castor.xml.util.ContainerElement.getParent(), org.exolab.castor.xml.handlers.ContainerFieldHandler.MODE_AUTO, org.exolab.castor.xml.handlers.ContainerFieldHandler.MODE_CHILD_LINK, and org.exolab.castor.mapping.FieldHandler.setValue().


Member Data Documentation


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties