Class TemplateDebugger
java.lang.Object
org.apache.commons.jexl3.parser.ParserVisitor
org.apache.commons.jexl3.internal.Debugger
org.apache.commons.jexl3.internal.TemplateDebugger
- All Implemented Interfaces:
JexlInfo.Detail
A visitor for templates.
A friend (ala C++) of template engine.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate TemplateEngine.TemplateExpression[]The expressions called by the script through jexl:print.private ASTJexlScriptThe outer script.Fields inherited from class org.apache.commons.jexl3.internal.Debugger
arrow, builder, cause, depth, end, indent, indentLevel, lf, outputPragmas, QUOTED_IDENTIFIER, start -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectacceptStatement(JexlNode child, Object data) Adds a statement node to the rebuilt expression.booleanPosition the debugger on the root of a template expression.booleanPosition the debugger on the root of a template script.getPrintStatement(JexlNode child) In a template, any statement that is not 'jexl:print(n)' must be prefixed by "$$".private voidInsert $$ and \n when needed.private voidInsert \n when needed.voidreset()Resets this debugger state.private Objectvisit(TemplateEngine.CompositeExpression expr, Object data) Visit a composite expression.private Objectvisit(TemplateEngine.ConstantExpression expr, Object data) Visit a constant expression.private Objectvisit(TemplateEngine.DeferredExpression expr, Object data) Visit a deferred expression.private Objectvisit(TemplateEngine.ImmediateExpression expr, Object data) Visit an immediate expression.private Objectvisit(TemplateEngine.NestedExpression expr, Object data) Visit a nested expression.private Objectvisit(TemplateEngine.TemplateExpression expr, Object data) Visit a template expression.protected ObjectMethods inherited from class org.apache.commons.jexl3.internal.Debugger
accept, additiveNode, check, data, debug, debug, debug, debug, depth, end, getFeatures, indentation, infixChildren, lineFeed, needQuotes, outputPragmas, postfixChild, prefixChild, setArrowSymbol, setIndentation, start, toString, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitParameterMethods inherited from class org.apache.commons.jexl3.parser.ParserVisitor
visit, visit
-
Field Details
-
script
The outer script. -
exprs
The expressions called by the script through jexl:print.
-
-
Constructor Details
-
TemplateDebugger
public TemplateDebugger()Default ctor.
-
-
Method Details
-
acceptStatement
Description copied from class:DebuggerAdds a statement node to the rebuilt expression.- Overrides:
acceptStatementin classDebugger- Parameters:
child- the child nodedata- visitor pattern argument- Returns:
- visitor pattern value
-
debug
Position the debugger on the root of a template expression.- Parameters:
je- the expression- Returns:
- true if the expression was a
TemplateEngine.TemplateExpressioninstance, false otherwise
-
debug
Position the debugger on the root of a template script.- Parameters:
jt- the template- Returns:
- true if the template was a
TemplateScriptinstance, false otherwise
-
getPrintStatement
In a template, any statement that is not 'jexl:print(n)' must be prefixed by "$$".- Parameters:
child- the node to check- Returns:
- the expression number or -1 if the node is not a jexl:print
-
newJexlLine
private void newJexlLine()Insert $$ and \n when needed. -
newJxltLine
private void newJxltLine()Insert \n when needed. -
reset
public void reset()Description copied from class:DebuggerResets this debugger state. -
visit
-
visit
Visit a composite expression.- Parameters:
expr- the composite expressiondata- the visitor argument- Returns:
- the visitor argument
-
visit
Visit a constant expression.- Parameters:
expr- the constant expressiondata- the visitor argument- Returns:
- the visitor argument
-
visit
Visit a deferred expression.- Parameters:
expr- the deferred expressiondata- the visitor argument- Returns:
- the visitor argument
-
visit
Visit an immediate expression.- Parameters:
expr- the immediate expressiondata- the visitor argument- Returns:
- the visitor argument
-
visit
Visit a nested expression.- Parameters:
expr- the nested expressiondata- the visitor argument- Returns:
- the visitor argument
-
visit
Visit a template expression.- Parameters:
expr- the constant expressiondata- the visitor argument- Returns:
- the visitor argument
-