public final class VariableInterpreter extends Object
Constructor and Description |
---|
VariableInterpreter() |
Modifier and Type | Method and Description |
---|---|
static Object |
_variable(PageContext pc,
String str,
Object value,
Scope scope) |
static Object |
getVariable(PageContext pc,
Collection collection,
String var)
reads a subelement from a struct
|
static Object |
getVariable(PageContext pc,
String var)
get a variable from page context
|
static Object |
getVariable(PageContext pc,
String str,
Scope scope) |
static Object |
getVariableAsCollection(PageContext pc,
String var) |
static Object |
getVariableEL(PageContext pc,
Collection collection,
String var) |
static Object |
getVariableEL(PageContext pc,
String var,
Object defaultValue)
get a variable from page context
|
static Object |
getVariableELAsCollection(PageContext pc,
String var,
Object defaultValue) |
static VariableReference |
getVariableReference(PageContext pc,
Collection.Key[] keys,
boolean keepScope) |
static VariableReference |
getVariableReference(PageContext pc,
Collection.Key key,
boolean keepScope) |
static VariableReference |
getVariableReference(PageContext pc,
String var)
return a variable reference by string syntax ("scopename.key.key" -> "url.name")
a variable reference, references to variable, to modifed it, with global effect.
|
static boolean |
isDefined(PageContext pc,
String var)
check if a variable is defined in Page Context
|
static StringList |
parse(String var,
boolean doLowerCase) |
static Object |
removeVariable(PageContext pc,
String var)
removes a variable eith matching name from page context
|
static Object |
scope(PageContext pc,
int scope,
boolean touch) |
static String |
scopeInt2String(int type) |
static int |
scopeKey2Int(Collection.Key type) |
static int |
scopeString2Int(String type)
translate a string type definition to its int representation
|
static Object |
setVariable(PageContext pc,
String var,
Object value)
sets a variable to page Context
|
static Object |
setVariable(PageContext pc,
String str,
Object value,
Scope scope) |
public VariableInterpreter()
public static Object getVariable(PageContext pc, Collection collection, String var) throws PageException
pc
- collection
- var
- PageException
public static String scopeInt2String(int type)
public static Object getVariableEL(PageContext pc, Collection collection, String var)
public static Object getVariable(PageContext pc, String var) throws PageException
pc
- Page Contextvar
- variable string to get value toPageException
public static Object getVariableAsCollection(PageContext pc, String var) throws PageException
PageException
public static Object getVariable(PageContext pc, String str, Scope scope) throws PageException
PageException
public static Object setVariable(PageContext pc, String str, Object value, Scope scope) throws PageException
PageException
public static Object _variable(PageContext pc, String str, Object value, Scope scope) throws PageException
PageException
public static Object getVariableEL(PageContext pc, String var, Object defaultValue)
pc
- Page Contextvar
- variable string to get value todefaultValue
- value returnded if variable was not foundpublic static Object getVariableELAsCollection(PageContext pc, String var, Object defaultValue)
public static VariableReference getVariableReference(PageContext pc, String var) throws PageException
pc
- var
- variable name to getPageException
public static VariableReference getVariableReference(PageContext pc, Collection.Key[] keys, boolean keepScope) throws PageException
PageException
public static VariableReference getVariableReference(PageContext pc, Collection.Key key, boolean keepScope)
public static Object setVariable(PageContext pc, String var, Object value) throws PageException
pc
- pagecontext of the new variablevar
- String of variable definitionvalue
- value to set to variablePageException
public static Object removeVariable(PageContext pc, String var) throws PageException
pc
- var
- PageException
public static boolean isDefined(PageContext pc, String var)
pc
- PageContext to checkvar
- variable Stringpublic static StringList parse(String var, boolean doLowerCase)
public static int scopeString2Int(String type)
type
- type to translatepublic static int scopeKey2Int(Collection.Key type)
public static Object scope(PageContext pc, int scope, boolean touch) throws PageException
PageException
Copyright © 2015 Lucee