|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.util.OgnlUtil
Utility class that provides common access to the Ognl APIs for setting and getting properties from objects (usually Actions).
Constructor Summary | |
OgnlUtil()
|
Method Summary | |
static Object |
compile(String expression)
|
static void |
copy(Object from,
Object to,
Map context)
Copies the properties in the object "from" and sets them in the object "to" using specified type converter, or XWorkConverter if none
is specified. |
static Object |
getRealTarget(String property,
Map context,
Object root)
Looks for the real target with the specified property given a root Object which may be a CompoundRoot. |
static void |
setProperties(Map properties,
Object o)
Sets the properties on the object using the default context, defaulting to not throwing exceptions for problems setting the properties. |
static void |
setProperties(Map properties,
Object o,
boolean throwPropertyExceptions)
Sets the properties on the object using the default context. |
static void |
setProperties(Map props,
Object o,
Map context)
Sets the object's properties using the default type converter, defaulting to not throw exceptions for problems setting the properties. |
static void |
setProperties(Map props,
Object o,
Map context,
boolean throwPropertyExceptions)
Sets the object's properties using the default type converter. |
static void |
setProperty(String name,
Object value,
Object o,
Map context)
Sets the named property to the supplied value on the Object, defaults to not throwing property exceptions. |
static void |
setProperty(String name,
Object value,
Object o,
Map context,
boolean throwPropertyExceptions)
Sets the named property to the supplied value on the Object. |
static void |
setValue(String name,
Map context,
Object root,
Object value)
Wrapper around Ognl.setValue() to handle type conversion for collection elements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public OgnlUtil()
Method Detail |
public static void setProperties(Map props, Object o, Map context)
props
- the properties being seto
- the objectcontext
- the action contextpublic static void setProperties(Map props, Object o, Map context, boolean throwPropertyExceptions)
props
- the properties being seto
- the objectcontext
- the action contextthrowPropertyExceptions
- boolean which tells whether it should throw exceptions for
problems setting the propertiespublic static void setProperties(Map properties, Object o)
properties
- o
- public static void setProperties(Map properties, Object o, boolean throwPropertyExceptions)
properties
- the property map to set on the objecto
- the object to set the properties intothrowPropertyExceptions
- boolean which tells whether it should throw exceptions for
problems setting the propertiespublic static void setProperty(String name, Object value, Object o, Map context)
name
- the name of the property to be setvalue
- the value to set into the named propertyo
- the object upon which to set the propertycontext
- the context which may include the TypeConverterpublic static void setProperty(String name, Object value, Object o, Map context, boolean throwPropertyExceptions)
name
- the name of the property to be setvalue
- the value to set into the named propertyo
- the object upon which to set the propertycontext
- the context which may include the TypeConverterthrowPropertyExceptions
- boolean which tells whether it should throw exceptions for
problems setting the propertypublic static Object getRealTarget(String property, Map context, Object root) throws ognl.OgnlException
ognl.OgnlException
public static void setValue(String name, Map context, Object root, Object value) throws ognl.OgnlException
ognl.OgnlException
public static Object compile(String expression) throws ognl.OgnlException
ognl.OgnlException
public static void copy(Object from, Object to, Map context)
XWorkConverter
if none
is specified.
from
- the source objectto
- the target objectcontext
- the action context we're running under
|
XWork Project Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |