|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork.util.OgnlValueStack
public class OgnlValueStack
OgnlValueStack allows multiple beans to be pushed in and dynamic Ognl expressions to be evaluated against it. When evaluating an expression, the stack will be searched down the stack, from the latest objects pushed in to the earliest, looking for a bean with a getter or setter for the given property or a method of the given name (depending on the expression being evaluated).
Nested Class Summary | |
---|---|
static class |
OgnlValueStack.ObjectAccessor
|
Field Summary | |
---|---|
static String |
REPORT_ERRORS_ON_NO_PROP
|
static String |
VALUE_STACK
|
Constructor Summary | |
---|---|
OgnlValueStack()
|
|
OgnlValueStack(OgnlValueStack vs)
|
Method Summary | |
---|---|
String |
findString(String expr)
|
Object |
findValue(String expr)
Find a value by evaluating the given expression against the stack in the default search order. |
Object |
findValue(String expr,
Class asType)
Find a value by evaluating the given expression against the stack in the default search order. |
static CompoundRootAccessor |
getAccessor()
|
Map |
getContext()
|
CompoundRoot |
getRoot()
Get the CompoundRoot which holds the objects pushed onto the stack |
boolean |
isDevModeEnabled()
Determine whether devMode is enabled. |
static void |
link(Map context,
Class clazz,
String name)
|
Object |
peek()
Get the object on the top of the stack without changing the stack. |
Object |
pop()
Get the object on the top of the stack and remove it from the stack. |
void |
push(Object o)
Put this object onto the top of the stack |
static void |
reset()
|
void |
setDefaultType(Class defaultType)
Sets the default type to convert to if no type is provided when getting a value. |
void |
setExprOverrides(Map overrides)
|
void |
setValue(String expr,
Object value)
Attempts to set a property on a bean in the stack with the given expression using the default search order. |
void |
setValue(String expr,
Object value,
boolean throwExceptionOnFailure)
Attempts to set a property on a bean in the stack with the given expression using the default search order. |
int |
size()
Get the number of objects in the stack s |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String VALUE_STACK
public static final String REPORT_ERRORS_ON_NO_PROP
Constructor Detail |
---|
public OgnlValueStack()
public OgnlValueStack(OgnlValueStack vs)
Method Detail |
---|
public static void reset()
public static void link(Map context, Class clazz, String name)
public static CompoundRootAccessor getAccessor()
public Map getContext()
public void setDefaultType(Class defaultType)
defaultType
- public void setExprOverrides(Map overrides)
public CompoundRoot getRoot()
public boolean isDevModeEnabled()
public void setValue(String expr, Object value)
expr
- the expression defining the path to the property to be set.value
- the value to be set into the neamed propertypublic void setValue(String expr, Object value, boolean throwExceptionOnFailure)
expr
- the expression defining the path to the property to be set.value
- the value to be set into the neamed propertythrowExceptionOnFailure
- a flag to tell whether an exception should be thrown if there is no property with
the given name.public String findString(String expr)
public Object findValue(String expr)
expr
- the expression giving the path of properties to navigate to find the property value to return
public Object findValue(String expr, Class asType)
expr
- the expression giving the path of properties to navigate to find the property value to returnasType
- the type to convert the return value to
public Object peek()
CompoundRoot.peek()
public Object pop()
CompoundRoot.pop()
public void push(Object o)
o
- the object to be pushed onto the stackCompoundRoot.push(Object)
public int size()
|
WebWork Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |