Public Member Functions

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

Inheritance diagram for org.exolab.castor.xml.handlers.CollectionFieldHandler:
org.exolab.castor.xml.XMLFieldHandler org.exolab.castor.mapping.AbstractFieldHandler org.exolab.castor.mapping.ExtendedFieldHandler org.exolab.castor.mapping.loader.FieldHandlerFriend org.exolab.castor.mapping.FieldHandler

List of all members.

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)

Detailed Description

A FieldHandler for the XML Schema Collection type. TODO : support all kind of XSList

Author:
Arnaud Blandin
Version:
Revision:
1.1.1.1
Date:
2003/03/03 07:09:26

Constructor & Destructor Documentation

org.exolab.castor.xml.handlers.CollectionFieldHandler.CollectionFieldHandler ( FieldHandler  fieldHandler  ) 

Creates a new CollectionFieldHandler using the given FieldHandler for delegation.

Parameters:
fieldHandler the fieldHandler for delegation.
org.exolab.castor.xml.handlers.CollectionFieldHandler.CollectionFieldHandler ( FieldHandler  fieldHandler,
TypeValidator  validator 
)

Member Function Documentation

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.

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

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.

Returns:
true if the given object is an XMLFieldHandler that is equivalent to this one.

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

Parameters:
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.

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

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.

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

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.

Parameters:
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().


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