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

java.lang.Object
  extended byorg.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField
      extended byorg.apache.ojb.broker.metadata.fieldaccess.PersistentFieldAutoProxyImpl
All Implemented Interfaces:
PersistentField, java.io.Serializable

public class PersistentFieldAutoProxyImpl
extends AbstractPersistentField

PeristentField implementation that attempts to detect the nature of the field it is persisting.

First checks to see if it is a Field, then Property, then DynaBean

It will match in that order.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField
PATH_TOKEN, PERSISTENT_FIELD_IMPL_FOR_NESTED
 
Constructor Summary
PersistentFieldAutoProxyImpl()
          Being nice to Class.newInstance() seems popular.
PersistentFieldAutoProxyImpl(java.lang.Class type, java.lang.String fieldName)
          Creates a new auto handler object for the indicated field.
 
Method Summary
 java.lang.Object doGet(java.lang.Object targetObject)
          Gets the field value from the given target object.
 void doSet(java.lang.Object targetObject, java.lang.Object value)
          Set the field value for the given target object.
 java.lang.Class getDeclaringClass()
           
 java.lang.String getName()
           
 java.lang.Class getType()
           
 boolean makeAccessible()
          A value of true indicates that this field should suppress Java language access checking when it is used.
 java.lang.String toString()
           
 boolean usesAccessorsAndMutators()
           
 
Methods inherited from class org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField
buildMessageString, get, set
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentFieldAutoProxyImpl

public PersistentFieldAutoProxyImpl()
Being nice to Class.newInstance() seems popular.


PersistentFieldAutoProxyImpl

public PersistentFieldAutoProxyImpl(java.lang.Class type,
                                    java.lang.String fieldName)
Creates a new auto handler object for the indicated field.

Parameters:
type - The type of the object containing the field
fieldName - The name of the field
Method Detail

doSet

public void doSet(java.lang.Object targetObject,
                  java.lang.Object value)
Set the field value for the given target object.

Specified by:
doSet in class AbstractPersistentField
Parameters:
targetObject - The object that contains the field to set
value - The value to set

doGet

public java.lang.Object doGet(java.lang.Object targetObject)
Gets the field value from the given target object.

Specified by:
doGet in class AbstractPersistentField
Parameters:
targetObject - The object that contains the field to set
Returns:
The field's value

getDeclaringClass

public java.lang.Class getDeclaringClass()
Specified by:
getDeclaringClass in interface PersistentField
Overrides:
getDeclaringClass in class AbstractPersistentField

usesAccessorsAndMutators

public boolean usesAccessorsAndMutators()

getName

public java.lang.String getName()
Specified by:
getName in interface PersistentField
Overrides:
getName in class AbstractPersistentField

getType

public java.lang.Class getType()
Specified by:
getType in interface PersistentField
Overrides:
getType in class AbstractPersistentField

makeAccessible

public boolean makeAccessible()
Description copied from class: AbstractPersistentField
A value of true indicates that this field should suppress Java language access checking when it is used.

Specified by:
makeAccessible in class AbstractPersistentField

toString

public java.lang.String toString()
Overrides:
toString in class AbstractPersistentField


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2