org.apache.ojb.broker.metadata.fieldaccess
Class PersistentFieldDirectImpl

java.lang.Object
  extended by org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldBase
      extended by org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectImpl
All Implemented Interfaces:
Serializable, PersistentField
Direct Known Subclasses:
PersistentFieldDirectAccessImplNew, PersistentFieldPrivilegedImpl

public class PersistentFieldDirectImpl
extends PersistentFieldBase

This PersistentField implementation is the high-speed version of the access strategies.
It does not cooperate with an AccessController, but accesses the fields directly. This implementation persistent attributes don't need getters and setters and don't have to be declared public or protected. Only the the metadata field names have to match the class fields.

Version:
$Id: PersistentFieldDirectImpl.java,v 1.1 2007-08-24 22:17:35 ewestfal Exp $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldBase
PATH_TOKEN, rootObjectType
 
Constructor Summary
PersistentFieldDirectImpl()
           
PersistentFieldDirectImpl(Class type, String fieldname)
           
 
Method Summary
 Object get(Object target)
          do not override this method, have a look at getValueFrom(java.lang.reflect.Field, Object)
protected  Field getField()
          Returns the underlying field object.
 Class getType()
           
protected  Object getValueFrom(Field field, Object target)
           
protected  boolean isNestedField()
           
protected  boolean makeAccessible()
          This implementation returns always 'true'.
 void set(Object target, Object value)
          do not override this method, have a look at setValueFor(java.lang.reflect.Field, Object, Object)
protected  void setValueFor(Field field, Object target, Object value)
           
 boolean usesAccessorsAndMutators()
          Always returns 'false'.
 
Methods inherited from class org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldBase
buildErrorGetMsg, buildErrorSetMsg, getDeclaringClass, getFieldGraph, getLog, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentFieldDirectImpl

public PersistentFieldDirectImpl()

PersistentFieldDirectImpl

public PersistentFieldDirectImpl(Class type,
                                 String fieldname)
Method Detail

getType

public Class getType()

getField

protected Field getField()
Returns the underlying field object. If parameter setAccessible is true the field access checking was suppressed.


isNestedField

protected boolean isNestedField()

set

public void set(Object target,
                Object value)
         throws MetadataException
do not override this method, have a look at setValueFor(java.lang.reflect.Field, Object, Object)

Parameters:
target - The target object (no proxy objects allowed).
value - The value to set.
Throws:
MetadataException - if there is an error setting this field value on obj
See Also:
Field

get

public Object get(Object target)
           throws MetadataException
do not override this method, have a look at getValueFrom(java.lang.reflect.Field, Object)

Parameters:
target - - The object instance (proxy objects are not allowed here) which we are trying to get the field value from.
Throws:
MetadataException - if there is an error getting this field value from obj
See Also:
Field

getValueFrom

protected Object getValueFrom(Field field,
                              Object target)

setValueFor

protected void setValueFor(Field field,
                           Object target,
                           Object value)

makeAccessible

protected boolean makeAccessible()
This implementation returns always 'true'.

Specified by:
makeAccessible in class PersistentFieldBase

usesAccessorsAndMutators

public boolean usesAccessorsAndMutators()
Always returns 'false'.

See Also:
PersistentField.usesAccessorsAndMutators()


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.