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 ASTJexlScript
The 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 Object
acceptStatement
(JexlNode child, Object data) Adds a statement node to the rebuilt expression.boolean
Position the debugger on the root of a template expression.boolean
Position 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 void
Insert $$ and \n when needed.private void
Insert \n when needed.void
reset()
Resets this debugger state.private Object
visit
(TemplateEngine.CompositeExpression expr, Object data) Visit a composite expression.private Object
visit
(TemplateEngine.ConstantExpression expr, Object data) Visit a constant expression.private Object
visit
(TemplateEngine.DeferredExpression expr, Object data) Visit a deferred expression.private Object
visit
(TemplateEngine.ImmediateExpression expr, Object data) Visit an immediate expression.private Object
visit
(TemplateEngine.NestedExpression expr, Object data) Visit a nested expression.private Object
visit
(TemplateEngine.TemplateExpression expr, Object data) Visit a template expression.protected Object
Methods 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, visitParameter
Methods 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
-
reset
public void reset()Description copied from class:Debugger
Resets this debugger state. -
debug
Position the debugger on the root of a template expression.- Parameters:
je
- the expression- Returns:
- true if the expression was a
TemplateEngine.TemplateExpression
instance, false otherwise
-
debug
Position the debugger on the root of a template script.- Parameters:
jt
- the template- Returns:
- true if the template was a
TemplateScript
instance, false otherwise
-
visit
-
acceptStatement
Description copied from class:Debugger
Adds a statement node to the rebuilt expression.- Overrides:
acceptStatement
in classDebugger
- Parameters:
child
- the child nodedata
- visitor pattern argument- Returns:
- visitor pattern value
-
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. -
visit
Visit a template expression.- Parameters:
expr
- the constant 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 an immediate expression.- Parameters:
expr
- the immediate 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 a nested expression.- Parameters:
expr
- the nested expressiondata
- the visitor argument- Returns:
- the visitor argument
-
visit
Visit a composite expression.- Parameters:
expr
- the composite expressiondata
- the visitor argument- Returns:
- the visitor argument
-