Package org.apache.cayenne.reflect
Class FieldAccessor
java.lang.Object
org.apache.cayenne.reflect.FieldAccessor
- All Implemented Interfaces:
Serializable
,Accessor
A PropertyAccessor that performs direct Field access.
- Since:
- 1.2
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionFieldAccessor
(Class<?> objectClass, String propertyName, Class<?> propertyType) -
Method Summary
Modifier and TypeMethodDescriptiongetName()
Returns property name.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
Sets a property value of an object without disturbing the object fault status.
-
Field Details
-
propertyName
-
field
-
nullValue
-
-
Constructor Details
-
FieldAccessor
-
-
Method Details
-
getName
Description copied from interface:Accessor
Returns property name. -
getValue
Description copied from interface:Accessor
Returns a property value of an object without disturbing the object fault status.- Specified by:
getValue
in interfaceAccessor
- Throws:
PropertyException
-
setValue
Description copied from interface:Accessor
Sets a property value of an object without disturbing the object fault status. Old value of the property is specified as a hint.- Specified by:
setValue
in interfaceAccessor
- Throws:
PropertyException
- Since:
- 3.0
-
prepareField
Finds a field for the property, ensuring that direct access via reflection is possible. -
lookupFieldInHierarchy
protected Field lookupFieldInHierarchy(Class<?> beanClass, String fieldName) throws SecurityException, NoSuchFieldException Recursively looks for a named field in a class hierarchy.
-