tyrex.resource.castor
Class ResourceFieldHandlerImpl

java.lang.Object
  extended bytyrex.resource.castor.ResourceFieldHandlerImpl
All Implemented Interfaces:
org.exolab.castor.mapping.FieldHandler

class ResourceFieldHandlerImpl
extends java.lang.Object
implements org.exolab.castor.mapping.FieldHandler

Implementation of FieldHandler.


Constructor Summary
(package private) ResourceFieldHandlerImpl(java.lang.reflect.Method method, java.lang.Class type)
          Create the ResourceFieldHandlerImpl
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceFieldHandlerImpl

ResourceFieldHandlerImpl(java.lang.reflect.Method method,
                         java.lang.Class type)
Create the ResourceFieldHandlerImpl

Parameters:
method - the set method (required)
type - the type of the set method parameter (optional)
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.

Specified by:
getValue in interface org.exolab.castor.mapping.FieldHandler
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.

Specified by:
setValue in interface org.exolab.castor.mapping.FieldHandler
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.

Specified by:
resetValue in interface org.exolab.castor.mapping.FieldHandler
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 org.exolab.castor.mapping.ValidityException,
                          java.lang.IllegalStateException
Deprecated. No longer supported

Specified by:
checkValidity in interface org.exolab.castor.mapping.FieldHandler
Throws:
org.exolab.castor.mapping.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.

Specified by:
newInstance in interface org.exolab.castor.mapping.FieldHandler
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


Original code is Copyright (c) 1999-2001, Intalio, Inc. All Rights Reserved. Contributions by MetaBoss team are Copyright (c) 2003-2005, Softaris Pty. Ltd. All Rights Reserved.