|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ValueStack
ValueStack allows multiple beans to be pushed in and dynamic EL 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).
Field Summary | |
---|---|
static String |
REPORT_ERRORS_ON_NO_PROP
|
static String |
VALUE_STACK
|
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. |
Map |
getContext()
Gets the context for this value stack. |
Map |
getExprOverrides()
Gets the override map if anyone exists. |
CompoundRoot |
getRoot()
Get the CompoundRoot which holds the objects pushed onto the stack |
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 |
void |
set(String key,
Object o)
Sets an object on the stack with the given key so it is retrievable by findValue(String) , findValue(String, Class) |
void |
setDefaultType(Class defaultType)
Sets the default type to convert to if no type is provided when getting a value. |
void |
setExprOverrides(Map overrides)
Set a override map containing key -> values that takes precedent when doing find operations on the ValueStack. |
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 |
Field Detail |
---|
static final String VALUE_STACK
static final String REPORT_ERRORS_ON_NO_PROP
Method Detail |
---|
Map getContext()
void setDefaultType(Class defaultType)
defaultType
- the new default typevoid setExprOverrides(Map overrides)
key -> values
that takes precedent when doing find operations on the ValueStack.
See the unit test for ValueStackTest for examples.
overrides
- overrides map.Map getExprOverrides()
CompoundRoot getRoot()
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 named propertyvoid 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 named propertythrowExceptionOnFailure
- a flag to tell whether an exception should be thrown if there is no property with
the given name.String findString(String expr)
Object findValue(String expr)
expr
- the expression giving the path of properties to navigate to find the property value to return
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
Object peek()
CompoundRoot.peek()
Object pop()
CompoundRoot.pop()
void push(Object o)
o
- the object to be pushed onto the stackCompoundRoot.push(Object)
void set(String key, Object o)
findValue(String)
, findValue(String, Class)
key
- the keyo
- the objectint size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |