|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XScriptManager
XScriptManager
is the public interface used to
interact with the XScript component, which implements the
supporting code for the XScript language.
Field Summary | |
---|---|
static int |
ALL_SCOPES
Search for a variable in all the accessible scopes. |
static int |
GLOBAL_SCOPE
The variable's global scope. |
static int |
PAGE_SCOPE
The page scope. |
static int |
REQUEST_SCOPE
The request scope. |
static String |
ROLE
|
static int |
SESSION_SCOPE
The session scope. |
static String |
XSCRIPT_NS
|
Method Summary | |
---|---|
XScriptObject |
get(XScriptVariableScope pageScope,
Map objectModel,
String name,
int scope)
Obtains the object value of the name variable in scope . |
XScriptObject |
getFirst(XScriptVariableScope pageScope,
Map objectModel,
String name)
Search for the first occurence of the variable name . |
void |
put(XScriptVariableScope pageScope,
Map objectModel,
String name,
XScriptObject value,
int scope)
Defines or overwrites the value of variable name in scope . |
XScriptObject |
remove(XScriptVariableScope pageScope,
Map objectModel,
String name,
int scope)
Removes a variable previously declared in scope
within context . |
XScriptObject |
removeFirst(XScriptVariableScope pageScope,
Map objectModel,
String name)
Remove the first appearance of name in the all the
currently accessible scopes. |
Field Detail |
---|
static final String ROLE
static final String XSCRIPT_NS
static final int GLOBAL_SCOPE
static final int SESSION_SCOPE
static final int PAGE_SCOPE
static final int REQUEST_SCOPE
static final int ALL_SCOPES
Method Detail |
---|
XScriptObject get(XScriptVariableScope pageScope, Map objectModel, String name, int scope) throws IllegalArgumentException
name
variable in scope
. The
context
parameter is interpreted differently
depending on the value of scope
, as follows:
scope
is GLOBAL_SCOPE
, the
value of context is ignored.
- if
scope
is SESSION_SCOPE
, the value of context
is
interpreted as the session identifier.
- if
scope
is PAGE_SCOPE
, the value
of context
is interpreted as an identifier of the
page. This could be the URL of the page or the path of the file
name in the file system.
objectModel
- an instance of Cocoon object model used to obtain contextname
- a String
valuescope
- an int
value
XScriptObject
value
IllegalArgumentException
XScriptObject getFirst(XScriptVariableScope pageScope, Map objectModel, String name) throws IllegalArgumentException
name
.
The search happens first in the session scope
identified by sessionContext
. If no variable is
found here, the search continues in the page scope identified by
pageContext
. If no variable is found here, it's
finally searched in the global scope.
The XScriptObject
value of the variable is
returned if a variable is found in one of the scopes, otherwise
an exception is thrown.
objectModel
- an instance of Cocoon object model used to obtain contextname
- a String
value
XScriptObject
value
IllegalArgumentException
- if an error occursvoid put(XScriptVariableScope pageScope, Map objectModel, String name, XScriptObject value, int scope) throws IllegalArgumentException
name
in scope
. The context
argument is interpreted as described in
get(XScriptVariableScope, Map, String, int)
.
objectModel
- an instance of Cocoon object model used to obtain contextname
- a String
valuevalue
- a XScriptObject
valuescope
- an int
value
IllegalArgumentException
XScriptObject remove(XScriptVariableScope pageScope, Map objectModel, String name, int scope) throws IllegalArgumentException
scope
within context
. Such a variable could be declared
using the put(XScriptVariableScope, Map, String, XScriptObject, int)
method.
objectModel
- an instance of Cocoon object model used to obtain contextname
- a String
valuescope
- an int
value
IllegalArgumentException
- if an error occursXScriptObject removeFirst(XScriptVariableScope pageScope, Map objectModel, String name) throws IllegalArgumentException
name
in the all the
currently accessible scopes. The search happens as described in
getFirst(XScriptVariableScope, Map, String)
.
objectModel
- an instance of Cocoon object model used to obtain contextname
- a String
value
IllegalArgumentException
- if an error occurs
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |