public static class ValueStack.LegacyAdapter extends Object implements ValueStack
ValueStack.LegacyAdapterREPORT_ERRORS_ON_NO_PROP, VALUE_STACK| Modifier and Type | Method and Description |
|---|---|
String |
findString(String expr) |
String |
findString(String expr,
boolean throwExceptionOnFailure) |
Object |
findValue(String expr)
Find a value by evaluating the given expression against the stack in the default search order.
|
Object |
findValue(String expr,
boolean throwExceptionOnFailure) |
Object |
findValue(String expr,
Class asType)
Find a value by evaluating the given expression against the stack in the default search order.
|
Object |
findValue(String expr,
Class asType,
boolean throwExceptionOnFailure) |
ActionContext |
getActionContext() |
Map<String,Object> |
getContext()
Gets the context for this value stack.
|
Map<Object,Object> |
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
ValueStack.findValue(String), ValueStack.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<Object,Object> overrides)
Set a override map containing
key -> values that takes precedent when doing find operations on the ValueStack. |
void |
setParameter(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)
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
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadaptpublic Map<String,Object> getContext()
ValueStackgetContext in interface ValueStackpublic ActionContext getActionContext()
getActionContext in interface ValueStackpublic void setDefaultType(Class defaultType)
ValueStacksetDefaultType in interface ValueStackdefaultType - the new default typepublic void setExprOverrides(Map<Object,Object> overrides)
ValueStack key -> values that takes precedent when doing find operations on the ValueStack.
See the unit test for ValueStackTest for examples.
setExprOverrides in interface ValueStackoverrides - overrides map.public Map<Object,Object> getExprOverrides()
ValueStackgetExprOverrides in interface ValueStackpublic CompoundRoot getRoot()
ValueStackgetRoot in interface ValueStackpublic void setValue(String expr, Object value)
ValueStacksetValue in interface ValueStackexpr - the expression defining the path to the property to be set.value - the value to be set into the named propertypublic void setParameter(String expr, Object value)
ValueStacksetParameter in interface ValueStackexpr - the expression defining the path to the property to be set.value - the value to be set into the named propertypublic void setValue(String expr, Object value, boolean throwExceptionOnFailure)
ValueStacksetValue in interface ValueStackexpr - 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.public String findString(String expr)
findString in interface ValueStackpublic String findString(String expr, boolean throwExceptionOnFailure)
findString in interface ValueStackpublic Object findValue(String expr)
ValueStackfindValue in interface ValueStackexpr - the expression giving the path of properties to navigate to find the property value to returnpublic Object findValue(String expr, boolean throwExceptionOnFailure)
findValue in interface ValueStackpublic Object findValue(String expr, Class asType)
ValueStackfindValue in interface ValueStackexpr - the expression giving the path of properties to navigate to find the property value to returnasType - the type to convert the return value topublic Object findValue(String expr, Class asType, boolean throwExceptionOnFailure)
findValue in interface ValueStackpublic Object peek()
ValueStackpeek in interface ValueStackCompoundRoot.peek()public Object pop()
ValueStackpop in interface ValueStackCompoundRoot.pop()public void push(Object o)
ValueStackpush in interface ValueStacko - the object to be pushed onto the stackCompoundRoot.push(Object)public void set(String key, Object o)
ValueStackValueStack.findValue(String), ValueStack.findValue(String, Class)set in interface ValueStackkey - the keyo - the objectpublic int size()
ValueStacksize in interface ValueStackCopyright © 2000–2025 Apache Software Foundation. All rights reserved.