Package webwork.util
Class ValueStack
java.lang.Object
webwork.util.ValueStack
- Direct Known Subclasses:
ServletValueStack
Value stack. A VS is used by the WebWork system as a way to make findInContext values available by using the push and
pop methods. They can then be accessed by using the find* methods.
- Version:
- $Revision: 1.61 $
- Author:
- Rickard Öberg (rickard@middleware-company.com), Maurice C. Parker (maurice@vineyardenterprise.com)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidClear the method cache.protected ObjectfindInContext(String id) Find a value by id.protected webwork.util.ValueStack.MethodInfofindMethod(webwork.util.ValueStack.MethodInfo[] m, Object[] params) Find a value for a given name.protected webwork.util.ValueStack.MethodInfo[]Get a method with a given name.protected ObjectgetParameter(String aName) booleanisEmpty()Returns TRUE is the value stack is empty.iterator()peek()Peek at the object that is at the top of the stack.popValue()Pop a value from the value stack.voidPush a value onto the value stack.intsize()Returns the size of the value stack.booleanResolve a WebWork expression statement.toString()Return a string representation of the Stackprotected ObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
STACK_NAME
- See Also:
-
WEBWORK_VALUE_STACK_LOG_EXCEPTIONS
A System property name that controls whether value stack exceptions are logged or not. By default they are logged.- See Also:
-
classes
-
-
Constructor Details
-
ValueStack
public ValueStack()
-
-
Method Details
-
clearMethods
public static void clearMethods()Clear the method cache. This must be called if the application is restarted. -
pushValue
Push a value onto the value stack.- Parameters:
value- the value
-
peek
Peek at the object that is at the top of the stack. The object is returned unmodified, so if it would be a ValueHolder it is not unwrapped -
popValue
Pop a value from the value stack.- Returns:
- the popped value
-
iterator
-
size
public int size()Returns the size of the value stack.- Returns:
- size of value stack
-
isEmpty
public boolean isEmpty()Returns TRUE is the value stack is empty.- Returns:
- true is value stack is empty
-
test
Resolve a WebWork expression statement.- Parameters:
expression-- Returns:
- the boolean result of the expression
-
findInContext
Find a value by id. This method can be overridden by subclasses to have some context concept to evaluate- Parameters:
id- the value id.- Returns:
- value
-
unwrap
-
findValue
Find a value for a given name.- Parameters:
query-- Returns:
- the object corresponding to the query
- Throws:
IllegalArgumentException
-
findValue
- Throws:
IllegalArgumentException
-
toString
Return a string representation of the Stack -
getMethod
protected webwork.util.ValueStack.MethodInfo[] getMethod(Class<?> cl, String name) throws IntrospectionException Get a method with a given name.- Parameters:
cl- the class of the methodname- the name of the method- Returns:
- the wanted method
- Throws:
IntrospectionException
-
findMethod
protected webwork.util.ValueStack.MethodInfo findMethod(webwork.util.ValueStack.MethodInfo[] m, Object[] params) -
getParameter
-