railo.runtime.interpreter
Class VariableInterpreter

java.lang.Object
  extended by railo.runtime.interpreter.VariableInterpreter

public final class VariableInterpreter
extends Object

Class to check and interpret Variable Strings


Constructor Summary
VariableInterpreter()
           
 
Method Summary
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 getVariableEL(PageContext pc, Collection collection, String var)
           
static Object getVariableEL(PageContext pc, String var)
          get a variable from page context
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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableInterpreter

public VariableInterpreter()
Method Detail

getVariable

public static Object getVariable(PageContext pc,
                                 Collection collection,
                                 String var)
                          throws PageException
reads a subelement from a struct

Parameters:
pc -
collection -
var -
Returns:
matching Object
Throws:
PageException

scopeInt2String

public static String scopeInt2String(int type)

getVariableEL

public static Object getVariableEL(PageContext pc,
                                   Collection collection,
                                   String var)

getVariable

public static Object getVariable(PageContext pc,
                                 String var)
                          throws PageException
get a variable from page context

Parameters:
pc - Page Context
var - variable string to get value to
Returns:
the value
Throws:
PageException

getVariable

public static Object getVariable(PageContext pc,
                                 String str,
                                 Scope scope)
                          throws PageException
Throws:
PageException

setVariable

public static Object setVariable(PageContext pc,
                                 String str,
                                 Object value,
                                 Scope scope)
                          throws PageException
Throws:
PageException

_variable

public static Object _variable(PageContext pc,
                               String str,
                               Object value,
                               Scope scope)
                        throws PageException
Throws:
PageException

getVariableEL

public static Object getVariableEL(PageContext pc,
                                   String var)
get a variable from page context

Parameters:
pc - Page Context
var - variable string to get value to
Returns:
the value

getVariableReference

public static VariableReference getVariableReference(PageContext pc,
                                                     String var)
                                              throws PageException
return a variable reference by string syntax ("scopename.key.key" -> "url.name") a variable reference, references to variable, to modifed it, with global effect.

Parameters:
pc -
var - variable name to get
Returns:
variable as Reference
Throws:
PageException

setVariable

public static Object setVariable(PageContext pc,
                                 String var,
                                 Object value)
                          throws PageException
sets a variable to page Context

Parameters:
pc - pagecontext of the new variable
var - String of variable definition
value - value to set to variable
Returns:
value setted
Throws:
PageException

removeVariable

public static Object removeVariable(PageContext pc,
                                    String var)
                             throws PageException
removes a variable eith matching name from page context

Parameters:
pc -
var -
Returns:
has removed or not
Throws:
PageException

isDefined

public static boolean isDefined(PageContext pc,
                                String var)
check if a variable is defined in Page Context

Parameters:
pc - PageContext to check
var - variable String
Returns:
exists or not

parse

public static StringList parse(String var,
                               boolean doLowerCase)

scopeString2Int

public static int scopeString2Int(String type)
translate a string type definition to its int representation

Parameters:
type - type to translate
Returns:
int representation matching to given string

scopeKey2Int

public static int scopeKey2Int(Collection.Key type)

scope

public static Object scope(PageContext pc,
                           int scope,
                           boolean touch)
                    throws PageException
Throws:
PageException


Copyright © 2012 Railo