public class Scope extends Object
| Constructor and Description |
|---|
Scope(Map<String,Object> backingMap,
boolean isLocal)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(String key)
Checks if this scope contains a variable of a certain name.
|
Object |
get(String key)
Retrieves the variable at this scope
|
boolean |
isLocal()
Returns whether or not this scope is "local".
|
void |
put(String key,
Object value)
Adds a variable to this scope
|
Scope |
shallowCopy()
Creates a shallow copy of the Scope.
|
public Scope shallowCopy()
This is used for the parallel tag because every new thread should have a "snapshot" of the scopes, i.e. one thread should not affect rendering output of another.
It will construct a new collection but it will contain references to all of the original variables therefore it is not a deep copy. This is why it is import for the user to use thread-safe variables when using the parallel tag.
public boolean isLocal()
public void put(String key, Object value)
key - The name of the variablevalue - The value of the variablepublic Object get(String key)
key - The name of the variablepublic boolean containsKey(String key)
key - The name of the variableCopyright © 2018. All rights reserved.