Package org.apache.cayenne.reflect
Class FieldAccessor
java.lang.Object
org.apache.cayenne.reflect.FieldAccessor
- All Implemented Interfaces:
- Serializable,- Accessor
public class FieldAccessor extends Object implements Accessor
A PropertyAccessor that performs direct Field access.
- Since:
- 1.2
- See Also:
- Serialized Form
- 
Field Summary
- 
Constructor SummaryConstructors Constructor Description FieldAccessor(Class<?> objectClass, String propertyName, Class<?> propertyType)
- 
Method SummaryModifier and Type Method Description StringgetName()Returns property name.ObjectgetValue(Object object)Returns a property value of an object without disturbing the object fault status.protected FieldlookupFieldInHierarchy(Class<?> beanClass, String fieldName)Recursively looks for a named field in a class hierarchy.protected FieldprepareField(Class<?> beanClass, String propertyName, Class<?> propertyType)Finds a field for the property, ensuring that direct access via reflection is possible.voidsetValue(Object object, Object newValue)Sets a property value of an object without disturbing the object fault status.
- 
Field Details- 
propertyName
- 
field
- 
nullValue
 
- 
- 
Constructor Details- 
FieldAccessor
 
- 
- 
Method Details- 
getNameDescription copied from interface:AccessorReturns property name.
- 
getValueDescription copied from interface:AccessorReturns a property value of an object without disturbing the object fault status.- Specified by:
- getValuein interface- Accessor
- Throws:
- PropertyException
 
- 
setValueDescription copied from interface:AccessorSets a property value of an object without disturbing the object fault status. Old value of the property is specified as a hint.- Specified by:
- setValuein interface- Accessor
- Throws:
- PropertyException
- Since:
- 3.0
 
- 
prepareFieldFinds a field for the property, ensuring that direct access via reflection is possible.
- 
lookupFieldInHierarchyprotected Field lookupFieldInHierarchy(Class<?> beanClass, String fieldName) throws SecurityException, NoSuchFieldExceptionRecursively looks for a named field in a class hierarchy.
 
-