org.exolab.castor.mapping
Interface FieldHandler

All Known Implementing Classes:
org.exolab.castor.mapping.loader.FieldHandlerFriend

public interface FieldHandler

A field handler knows how to perform various operations on the field that require access to the field value.

Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:08:26 $
Author:
Assaf Arkin
See Also:
FieldDescriptor

Method Summary
 void checkValidity(java.lang.Object object)
          Deprecated. No longer supported
 java.lang.Object getValue(java.lang.Object object)
          Returns the value of the field from the object.
 java.lang.Object newInstance(java.lang.Object parent)
          Creates a new instance of the object described by this field.
 void resetValue(java.lang.Object object)
          Sets the value of the field to a default value.
 void setValue(java.lang.Object object, java.lang.Object value)
          Sets the value of the field on the object.
 

Method Detail

getValue

public java.lang.Object getValue(java.lang.Object object)
                          throws java.lang.IllegalStateException
Returns the value of the field from the object.

Parameters:
object - The object
Returns:
The value of the field
Throws:
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 object

setValue

public void setValue(java.lang.Object object,
                     java.lang.Object value)
              throws java.lang.IllegalStateException,
                     java.lang.IllegalArgumentException
Sets the value of the field on the object.

Parameters:
object - The object
value - The new value
Throws:
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 object
java.lang.IllegalArgumentException

resetValue

public void resetValue(java.lang.Object object)
                throws java.lang.IllegalStateException,
                       java.lang.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
Throws:
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 object
java.lang.IllegalArgumentException

checkValidity

public void checkValidity(java.lang.Object object)
                   throws ValidityException,
                          java.lang.IllegalStateException
Deprecated. No longer supported

Throws:
ValidityException
java.lang.IllegalStateException

newInstance

public java.lang.Object newInstance(java.lang.Object parent)
                             throws java.lang.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
Throws:
java.lang.IllegalStateException - This field is a simple type and cannot be instantiated


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com