public class ScriptContext
extends java.lang.Object
It is built around a threadlocal. The entity that is executing the scripting call can set any desired values, and then execute the call. Important: after the call, the caller should invoke clear(), in order to erase all settings, preventing any bleedover to other calls on the same thread.
Although any arbitrary properties can be set on the script context, a few common properties have been defined directly on the class with convenience functions for getting and setting them.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
KEY_DEFAULT_DATASOURCE |
static java.lang.String |
KEY_DEFAULT_TAGPROVIDER |
static java.lang.String |
KEY_PARENT_PATH |
Constructor and Description |
---|
ScriptContext() |
Modifier and Type | Method and Description |
---|---|
static void |
clear()
Clears all properties set in the current thread local.
|
static java.lang.String |
defaultDatasource() |
static java.lang.String |
defaultTagProvider() |
static java.lang.Object |
get(java.lang.String key)
Gets the value of a key set on the script context.
|
static TagPath |
relativeTagPathRoot() |
static void |
set(java.lang.String key,
java.lang.Object value)
Sets the value of of a property on the script context.
|
static void |
setDefaultDatasource(java.lang.String value) |
static void |
setDefaultTagProvider(java.lang.String value) |
static void |
setRelativeTagPathRoot(TagPath path)
Sets the root tag path for relative path calculations.
|
public static final java.lang.String KEY_DEFAULT_DATASOURCE
public static final java.lang.String KEY_DEFAULT_TAGPROVIDER
public static final java.lang.String KEY_PARENT_PATH
public static java.lang.Object get(java.lang.String key)
public static void set(java.lang.String key, java.lang.Object value)
public static void clear()
public static java.lang.String defaultTagProvider()
public static void setDefaultTagProvider(java.lang.String value)
public static java.lang.String defaultDatasource()
public static void setDefaultDatasource(java.lang.String value)
public static TagPath relativeTagPathRoot()
public static void setRelativeTagPathRoot(TagPath path)