org.exolab.castor.mapping.handlers
Class TransientFieldHandler<T>

java.lang.Object
  extended by org.exolab.castor.mapping.loader.FieldHandlerFriend<T>
      extended by org.exolab.castor.mapping.ExtendedFieldHandler<T>
          extended by org.exolab.castor.mapping.AbstractFieldHandler<T>
              extended by org.exolab.castor.mapping.handlers.TransientFieldHandler<T>
All Implemented Interfaces:
ConfigurableFieldHandler<T>, FieldHandler<T>

public class TransientFieldHandler<T>
extends AbstractFieldHandler<T>

A dummy FieldHandler for "transient" fields. This allows us to create a FieldDescriptor, but not use a real FieldHandler.

Version:
$Revision: 9062 $ $Date: 2005-01-17 14:35:07 -0700 (Mon, 17 Jan 2005) $
Author:
kvisco

Field Summary
 
Fields inherited from class org.exolab.castor.mapping.AbstractFieldHandler
_properties
 
Constructor Summary
TransientFieldHandler()
           
 
Method Summary
 T getValue(Object target)
          Returns the value of the field from the object.
 T newInstance(Object target)
          Creates a new instance of the object described by this field.
 Object newInstance(Object target, Object[] args)
          Creates a new instance of the object described by this field.
 void resetValue(Object target)
          Sets the value of the field to a default value.
 void setValue(Object target, Object value)
          Sets the value of the field on the object.
 
Methods inherited from class org.exolab.castor.mapping.AbstractFieldHandler
getFieldDescriptor, hasValue, setConfiguration, setFieldDescriptor
 
Methods inherited from class org.exolab.castor.mapping.ExtendedFieldHandler
checkValidity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exolab.castor.mapping.FieldHandler
checkValidity
 

Constructor Detail

TransientFieldHandler

public TransientFieldHandler()
Method Detail

getValue

public T getValue(Object target)
Description copied from interface: FieldHandler
Returns the value of the field from the object.

Parameters:
target - The object
Returns:
The value of the field

newInstance

public T newInstance(Object target)
Description copied from interface: FieldHandler
Creates a new instance of the object described by this field.

Parameters:
target - The object for which the field is created
Returns:
A new instance of the field's value

newInstance

public Object newInstance(Object target,
                          Object[] args)
Description copied from class: ExtendedFieldHandler
Creates a new instance of the object described by this field.

Specified by:
newInstance in class ExtendedFieldHandler<T>
Parameters:
target - The object for which the field is created
args - the set of constructor arguments
Returns:
A new instance of the field's value

setValue

public void setValue(Object target,
                     Object value)
Description copied from interface: FieldHandler
Sets the value of the field on the object.

Parameters:
target - The object.
value - The new value.

resetValue

public void resetValue(Object target)
Description copied from interface: FieldHandler
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:
target - The object.


Copyright © 2013. All Rights Reserved.