Class ASTJexlScript

All Implemented Interfaces:
JexlParser.LexicalUnit, Node
Direct Known Subclasses:
ASTJexlLambda

public class ASTJexlScript extends JexlLexicalNode
Enhanced script to allow parameters declaration.
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      serial uid.
      See Also:
    • pragmas

      private Map<String,Object> pragmas
      The pragmas.
    • features

      private transient JexlFeatures features
      Features.
    • scope

      private transient Scope scope
      The script scope.
  • Constructor Details

    • ASTJexlScript

      public ASTJexlScript(int id)
    • ASTJexlScript

      public ASTJexlScript(Parser p, int id)
  • Method Details

    • script

      public ASTJexlScript script()
      Consider script with no parameters that return lambda as parametric-scripts.
      Returns:
      the script
    • jjtAccept

      public Object jjtAccept(ParserVisitor visitor, Object data)
      Description copied from class: SimpleNode
      Accept the visitor.
      Specified by:
      jjtAccept in interface Node
      Overrides:
      jjtAccept in class SimpleNode
      Parameters:
      visitor - the visitor
      data - contextual data
      Returns:
      result of visit
    • setPragmas

      public void setPragmas(Map<String,Object> thePragmas)
      Sets this script pragmas.
      Parameters:
      thePragmas - the pragmas
    • getPragmas

      public Map<String,Object> getPragmas()
      Returns:
      this script pragmas.
    • setFeatures

      public void setFeatures(JexlFeatures theFeatures)
      Sets this script features.
      Parameters:
      theFeatures - the features
    • getFeatures

      public JexlFeatures getFeatures()
      Returns:
      this script scope
    • setScope

      public void setScope(Scope theScope)
      Sets this script scope.
      Parameters:
      theScope - the scope
    • getScope

      public Scope getScope()
      Returns:
      this script scope
    • createFrame

      public Frame createFrame(Frame caller, Object... values)
      Creates an array of arguments by copying values up to the number of parameters.
      Parameters:
      caller - the calling frame
      values - the argument values
      Returns:
      the arguments array
    • createFrame

      public Frame createFrame(Object... values)
      Creates an array of arguments by copying values up to the number of parameters.
      Parameters:
      values - the argument values
      Returns:
      the arguments array
    • getArgCount

      public int getArgCount()
      Gets the (maximum) number of arguments this script expects.
      Returns:
      the number of parameters
    • getSymbols

      public String[] getSymbols()
      Gets this script symbols, i.e. parameters and local variables.
      Returns:
      the symbol names
    • getParameters

      public String[] getParameters()
      Gets this script parameters, i.e. symbols assigned before creating local variables.
      Returns:
      the parameter names
    • getLocalVariables

      public String[] getLocalVariables()
      Gets this script local variable, i.e. symbols assigned to local variables.
      Returns:
      the local variable names
    • isCapturedSymbol

      public boolean isCapturedSymbol(int symbol)
      Checks whether a given symbol is captured.
      Parameters:
      symbol - the symbol number
      Returns:
      true if captured, false otherwise
    • getCapturedVariables

      public String[] getCapturedVariables()
      Gets this script captured variable, i.e. symbols captured from outer scopes.
      Returns:
      the captured variable names