org.omnifaces.el
Class ScopedRunner
java.lang.Object
org.omnifaces.el.ScopedRunner
public class ScopedRunner
- extends java.lang.Object
This class helps in letting code run within its own scope. Such scope is defined by specific variables being
available to EL within it. The request scope is used to store the variables.
- Author:
- Arjan Tijms
Constructor Summary |
ScopedRunner(javax.faces.context.FacesContext context)
|
ScopedRunner(javax.faces.context.FacesContext context,
java.util.Map<java.lang.String,java.lang.Object> scopedVariables)
|
Method Summary |
void |
invoke(Callback.Void callback)
Invokes the callback within the scope of the variables being given in the constructor. |
ScopedRunner |
with(java.lang.String key,
java.lang.Object value)
Adds the given variable to this instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ScopedRunner
public ScopedRunner(javax.faces.context.FacesContext context)
ScopedRunner
public ScopedRunner(javax.faces.context.FacesContext context,
java.util.Map<java.lang.String,java.lang.Object> scopedVariables)
with
public ScopedRunner with(java.lang.String key,
java.lang.Object value)
- Adds the given variable to this instance. Can be used in a builder-pattern.
- Parameters:
key
- the key name of the variablevalue
- the value of the variable
- Returns:
- this ScopedRunner, so adding variables and finally calling invoke can be chained.
invoke
public void invoke(Callback.Void callback)
- Invokes the callback within the scope of the variables being given in the constructor.
- Parameters:
callback
-