public class ReflectionPropertyAccessCache extends Object implements IPropertyAccessCache
Modifier | Constructor and Description |
---|---|
protected |
ReflectionPropertyAccessCache()
Protected as this class should be used as Singleton but might be extended.
|
Modifier and Type | Method and Description |
---|---|
protected IFieldAccessor |
buildFieldAccessor(Field f)
To be overridden to change used implementation of
IFieldAccessor . |
protected IMethodInvoker |
buildMethodInvoker(Method m)
To be overridden to change used implementation of
IMethodInvoker . |
protected IFieldAccessor |
getAccessibleFieldAccessor(Field f)
Adds a check to verify that
getFieldAccessor(Field) returns an accessible Field. |
protected IMethodInvoker |
getAccessibleMethodInvoker(Method m)
Adds a check to verify that
getMethodInvoker(Method) returns an accessible Method. |
IFieldAccessor |
getFieldAccessor(Field f)
Searches in internal accessors cache, if not found builds the accessor.
|
static ReflectionPropertyAccessCache |
getInstance() |
IMethodInvoker |
getMethodInvoker(Method m)
Searches in internal invokers cache, if not found builds the invoker.
|
IMethodInvoker |
getReadMethod(Class<?> c,
String property,
Class<?> argType)
Searches for getter method corresponding to request in this class.
|
IMethodInvoker |
getReadMethod(Object o,
String property,
Class<?> argType)
Searches for getter method corresponding to request in this Object's class.
|
IFieldAccessor |
getStrictField(Class<?> c,
String property)
Searches for field corresponding to request in this Object's class, using provided property as strict name.
|
IFieldAccessor |
getStrictField(Object o,
String property)
Searches for field corresponding to request in this Object's class, using provided property as strict name.
|
IMethodInvoker |
getStrictMethod(Class<?> c,
String property,
Class<?>... argTypes)
Searches for method corresponding to request in this Object's class, using provided property as strict name.
|
IMethodInvoker |
getStrictMethod(Class<?> c,
String property,
Class<?> argType)
Searches for method corresponding to request in this Object's class, using provided property as strict name.
|
IMethodInvoker |
getStrictMethod(Object o,
String property,
Class<?>... argTypes)
Searches for method corresponding to request in this Object's class, using provided property as strict name.
|
IMethodInvoker |
getStrictMethod(Object o,
String property,
Class<?> argType)
Searches for method corresponding to request in this Object's class, using provided property as strict name.
|
Class<?> |
getStrictMethodParamType(Class<?> c,
String property,
Class<?> argType)
Searches for the parameter type of the write method of this property on this Class.
|
Class<?> |
getStrictMethodParamType(Object o,
String property,
Class<?> argType)
Searches for the parameter type of the write method of this property on this Object.
|
IMethodInvoker |
getWriteMethod(Class<?> c,
String property,
Class<?> argType)
Searches for setter method corresponding to request in this class.
|
IMethodInvoker |
getWriteMethod(Object o,
String property,
Class<?> argType)
Searches for setter method corresponding to request in this Object'sclass.
|
Class<?> |
getWriteMethodParamType(Class<?> c,
String property,
Class<?> argType)
Searches for the parameter type of the write method of this property on this Class.
|
Class<?> |
getWriteMethodParamType(Object o,
String property,
Class<?> argType)
Searches for the parameter type of the write method of this property on this Object.
|
String |
toBooleanGetter(String property)
Transforms a String property into a boolean getter name, according to getter / setter names specifications.
|
String |
toGetter(String property)
Transforms a String property into a getter name, according to getter / setter names specifications.
|
String |
toSetter(String property)
Transforms a String property into a setter name, according to getter / setter names specifications.
|
protected ReflectionPropertyAccessCache()
public static ReflectionPropertyAccessCache getInstance()
public IMethodInvoker getReadMethod(Object o, String property, Class<?> argType)
getReadMethod
in interface IPropertyAccessCache
public IMethodInvoker getReadMethod(Class<?> c, String property, Class<?> argType)
getReadMethod
in interface IPropertyAccessCache
public IMethodInvoker getWriteMethod(Object o, String property, Class<?> argType)
getWriteMethod
in interface IPropertyAccessCache
public IMethodInvoker getWriteMethod(Class<?> c, String property, Class<?> argType)
getWriteMethod
in interface IPropertyAccessCache
public Class<?> getWriteMethodParamType(Object o, String property, Class<?> argType)
getWriteMethodParamType
in interface IPropertyAccessCache
IMethodInvoker.getParameterTypes()
public Class<?> getWriteMethodParamType(Class<?> c, String property, Class<?> argType)
getWriteMethodParamType
in interface IPropertyAccessCache
IMethodInvoker.getParameterTypes()
public IMethodInvoker getStrictMethod(Object o, String property, Class<?> argType)
getStrictMethod
in interface IPropertyAccessCache
IPropertyAccessCache.getStrictMethod(Object, String, Class...)
public IMethodInvoker getStrictMethod(Class<?> c, String property, Class<?> argType)
getStrictMethod
in interface IPropertyAccessCache
IPropertyAccessCache.getStrictMethod(Class, String, Class...)
public Class<?> getStrictMethodParamType(Object o, String property, Class<?> argType)
getStrictMethodParamType
in interface IPropertyAccessCache
IMethodInvoker.getParameterTypes()
public Class<?> getStrictMethodParamType(Class<?> c, String property, Class<?> argType)
getStrictMethodParamType
in interface IPropertyAccessCache
IMethodInvoker.getParameterTypes()
public IMethodInvoker getStrictMethod(Object o, String property, Class<?>... argTypes)
IPropertyAccessCache
getStrictMethod
in interface IPropertyAccessCache
public IMethodInvoker getStrictMethod(Class<?> c, String property, Class<?>... argTypes)
IPropertyAccessCache
getStrictMethod
in interface IPropertyAccessCache
public IFieldAccessor getStrictField(Object o, String property)
getStrictField
in interface IPropertyAccessCache
public IFieldAccessor getStrictField(Class<?> c, String property)
getStrictField
in interface IPropertyAccessCache
public String toGetter(String property)
public String toBooleanGetter(String property)
public String toSetter(String property)
protected final IMethodInvoker getAccessibleMethodInvoker(Method m)
getMethodInvoker(Method)
returns an accessible Method.
Otherwise, returns null.public final IMethodInvoker getMethodInvoker(Method m)
protected final IFieldAccessor getAccessibleFieldAccessor(Field f)
getFieldAccessor(Field)
returns an accessible Field.
Otherwise, returns null.public final IFieldAccessor getFieldAccessor(Field f)
protected IMethodInvoker buildMethodInvoker(Method m)
IMethodInvoker
.protected IFieldAccessor buildFieldAccessor(Field f)
IFieldAccessor
.