|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.metadata.fieldaccess.PersistentFieldAutoProxyImpl
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.
Constructor Summary | |
PersistentFieldAutoProxyImpl()
Being nice to Class.newInstance() seems popular. |
|
PersistentFieldAutoProxyImpl(java.lang.Class type,
java.lang.String name)
Constructor will examine the Class type to attempt to determine what type of attribute this is (field, property, or DynaProperty and wrap an instance of the correct PersistentField implementation for that field. |
Method Summary | |
java.lang.Object |
get(java.lang.Object anObject)
Returns the value of the field represented by this PersistentField, on the specified object. |
java.lang.Class |
getDeclaringClass()
|
protected java.lang.reflect.Field |
getFieldRecursive(java.lang.Class c,
java.lang.String name)
REFACTOR: This is cut and paste code from PersistentFieldDefaultImpl, |
java.lang.String |
getName()
|
java.lang.Class |
getType()
|
void |
set(java.lang.Object obj,
java.lang.Object value)
Sets the field represented by this PersistentField object on the specified object argument to the specified new value. |
boolean |
usesAccessorsAndMutators()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PersistentFieldAutoProxyImpl()
public PersistentFieldAutoProxyImpl(java.lang.Class type, java.lang.String name)
TODO: Improve error reporting. Really need to keep why each one failed and give it lump some to the user so that the user can figure out why the one which was supposed to work didn't
Method Detail |
protected java.lang.reflect.Field getFieldRecursive(java.lang.Class c, java.lang.String name) throws java.lang.NoSuchFieldException
java.lang.NoSuchFieldException
- if no Field was found into the class hierarchypublic java.lang.Class getDeclaringClass()
getDeclaringClass
in interface PersistentField
public void set(java.lang.Object obj, java.lang.Object value) throws MetadataException
PersistentField
set
in interface PersistentField
MetadataException
- if there is an error setting this field value on objField
public java.lang.Object get(java.lang.Object anObject) throws MetadataException
PersistentField
get
in interface PersistentField
anObject
- - the object instance which we are trying to get the field value from
MetadataException
- if there is an error getting this field value from objField
public boolean usesAccessorsAndMutators()
usesAccessorsAndMutators
in interface PersistentField
public java.lang.String getName()
getName
in interface PersistentField
public java.lang.Class getType()
getType
in interface PersistentField
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |