|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.click.util.PropertyUtils
Provide property getter and setter utility methods.
Constructor Summary | |
PropertyUtils()
|
Method Summary | |
static Object |
getValue(Object source,
String name)
Return the property value for the given object and property name. |
static Object |
getValue(Object source,
String name,
Map cache)
Return the property value for the given object and property name. |
static Object |
getValueOgnl(Object source,
String name,
Map context)
Return the property value for the given object and property name using the OGNL library. |
static void |
setValueOgnl(Object target,
String name,
Object value,
Map context)
Return the property value for the given object and property name using the OGNL library. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PropertyUtils()
Method Detail |
public static Object getValue(Object source, String name)
This method is thread-safe, and caches reflected accessor methods in an internal synchronized cache.
If the given source object is a Map this method will simply return the value for the given key name.
source
- the source objectname
- the name of the property
public static Object getValue(Object source, String name, Map cache)
This method caches the reflected property methods in the given Map cache. You must NOT modify the cache. Also note cache is ONLY valid for the current thread, as access to the cache is not synchronized. If you need multi-threaded access to shared cache use a thread-safe Map object, such as Collections.synchronizedMap(new HashMap()).
If the given source object is a Map this method will simply return the value for the given key name.
source
- the source objectname
- the name of the propertycache
- the cache of reflected property Method objects, do NOT modify
this cache
public static Object getValueOgnl(Object source, String name, Map context) throws ognl.OgnlException
This method is thread-safe, and caches parsed OGNL expressions in an internal synchronized cache.
source
- the source objectname
- the name of the propertycontext
- the OGNL context, do NOT modify this object
ognl.OgnlException
- if an OGN error occurspublic static void setValueOgnl(Object target, String name, Object value, Map context) throws ognl.OgnlException
This method is thread-safe, and caches parsed OGNL expressions in an internal synchronized cache.
target
- the target object to set the property ofname
- the name of the property to setvalue
- the property value to setcontext
- the OGNL context, do NOT modify this object
ognl.OgnlException
- if an OGN error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |