|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.reflect.FieldAccessor
public class FieldAccessor
A PropertyAccessor that performs direct Field access.
Field Summary | |
---|---|
protected Field |
field
|
protected Object |
nullValue
|
protected String |
propertyName
|
Constructor Summary | |
---|---|
FieldAccessor(Class<?> objectClass,
String propertyName,
Class<?> propertyType)
|
Method Summary | |
---|---|
String |
getName()
Returns property name. |
Object |
getValue(Object object)
Returns a property value of an object without disturbing the object fault status. |
protected Field |
lookupFieldInHierarchy(Class<?> beanClass,
String fieldName)
Recursively looks for a named field in a class hierarchy. |
protected Field |
prepareField(Class<?> beanClass,
String propertyName,
Class<?> propertyType)
Finds a field for the property, ensuring that direct access via reflection is possible. |
void |
setValue(Object object,
Object newValue)
Sets a property value of an object without disturbing the object fault status. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String propertyName
protected Field field
protected Object nullValue
Constructor Detail |
---|
public FieldAccessor(Class<?> objectClass, String propertyName, Class<?> propertyType)
Method Detail |
---|
public String getName()
Accessor
getName
in interface Accessor
public Object getValue(Object object) throws PropertyException
Accessor
getValue
in interface Accessor
PropertyException
public void setValue(Object object, Object newValue) throws PropertyException
Accessor
setValue
in interface Accessor
PropertyException
protected Field prepareField(Class<?> beanClass, String propertyName, Class<?> propertyType)
protected Field lookupFieldInHierarchy(Class<?> beanClass, String fieldName) throws SecurityException, NoSuchFieldException
SecurityException
NoSuchFieldException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |