Top Description Fields Constructors Methods
org.apache.commons.jexl2

pack-priv final Class Debugger

extends Object
implements ParserVisitor
Class Inheritance
All Implemented Interfaces
org.apache.commons.jexl2.parser.ParserVisitor
Imports
java.util.regex.Pattern, org.apache.commons.jexl2.parser.ASTAdditiveNode, .ASTAdditiveOperator, .ASTAmbiguous, .ASTAndNode, .ASTArrayAccess, .ASTArrayLiteral, .ASTAssignment, .ASTBitwiseAndNode, .ASTBitwiseComplNode, .ASTBitwiseOrNode, .ASTBitwiseXorNode, .ASTBlock, .ASTConstructorNode, .ASTDivNode, .ASTEQNode, .ASTERNode, .ASTEmptyFunction, .ASTFalseNode, .ASTForeachStatement, .ASTFunctionNode, .ASTGENode, .ASTGTNode, .ASTIdentifier, .ASTIfStatement, .ASTJexlScript, .ASTLENode, .ASTLTNode, .ASTMapEntry, .ASTMapLiteral, .ASTMethodNode, .ASTModNode, .ASTMulNode, .ASTNENode, .ASTNRNode, .ASTNotNode, .ASTNullLiteral, .ASTNumberLiteral, .ASTOrNode, .ASTReference, .ASTReferenceExpression, .ASTReturnStatement, .ASTSizeFunction, .ASTSizeMethod, .ASTStringLiteral, .ASTTernaryNode, .ASTTrueNode, .ASTUnaryMinusNode, .ASTVar, .ASTWhileStatement, .JexlNode, .ParserVisitor, .SimpleNode

Helps pinpoint the cause of problems in expressions that fail during evaluation.

It rebuilds an expression string from the tree and the start/end offsets of the cause in that string.

This implies that exceptions during evaluation do allways carry the node that's causing the error.
Since
2.0

Field Summary

Modifier and TypeField and Description
private final StringBuilder
builder

The builder to compose messages.

private JexlNode
cause

The cause of the issue to debug.

private int
end

The ending character location offset of the cause in the builder.

private static final Pattern
QUOTED_IDENTIFIER

Checks identifiers that contain space, quote, double-quotes or backspace.

private int
start

The starting character location offset of the cause in the builder.

Constructor Summary

AccessConstructor and Description
pack-priv
Debugger()

Creates a Debugger.

Method Summary

Modifier and TypeMethod and Description
private Object

Returns:

visitor pattern value
accept
(JexlNode
the child node
node
,
Object
visitor pattern argument
data
)

Checks if a child node is the cause to debug & adds its representation to the rebuilt expression.

private Object

Returns:

visitor pattern value
acceptStatement
(JexlNode
the child node
child
,
Object
visitor pattern argument
data
)

Adds a statement node to the rebuilt expression.

private Object

Returns:

visitor pattern value
check
(JexlNode
the child node
node
,
String
the child node token image (may be null)
image
,
Object
visitor pattern argument
data
)

Checks if a terminal node is the the cause to debug & adds its representation to the rebuilt expression.

public String

Returns:

The rebuilt expression
data
()

public String

Returns:

the rebuilt expression
data
(JexlNode
the node to rebuilt from
node
)

Rebuilds an expression from a Jexl node.

public boolean

Returns:

true if the cause was located, false otherwise
debug
(JexlNode
the node to debug
node
)

Seeks the location of an error cause (a node) in an expression.

public int

Returns:

The end offset location of the cause in the expression
end
()

private Object

Returns:

visitor pattern value
infixChildren
(JexlNode
the child node
node
,
String
the child node token
infix
,
boolean
whether the child should be parenthesized
paren
,
Object
visitor pattern argument
data
)

Checks if the children of a node using infix notation is the cause to debug, adds their representation to the rebuilt expression.

private Object

Returns:

visitor pattern value
prefixChild
(JexlNode
the node
node
,
String
the node token
prefix
,
Object
visitor pattern argument
data
)

Checks if the child of a node using prefix notation is the cause to debug, adds their representation to the rebuilt expression.

public int

Returns:

The starting offset location of the cause in the expression
start
()

public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

builderback to summary
private final StringBuilder builder

The builder to compose messages.

causeback to summary
private JexlNode cause

The cause of the issue to debug.

endback to summary
private int end

The ending character location offset of the cause in the builder.

QUOTED_IDENTIFIERback to summary
private static final Pattern QUOTED_IDENTIFIER

Checks identifiers that contain space, quote, double-quotes or backspace.

startback to summary
private int start

The starting character location offset of the cause in the builder.

Constructor Detail

Debuggerback to summary
pack-priv Debugger()

Creates a Debugger.

Method Detail

acceptback to summary
private Object accept(JexlNode node, Object data)

Checks if a child node is the cause to debug & adds its representation to the rebuilt expression.

Parameters
node:JexlNode

the child node

data:Object

visitor pattern argument

Returns:Object

visitor pattern value

acceptStatementback to summary
private Object acceptStatement(JexlNode child, Object data)

Adds a statement node to the rebuilt expression.

Parameters
child:JexlNode

the child node

data:Object

visitor pattern argument

Returns:Object

visitor pattern value

checkback to summary
private Object check(JexlNode node, String image, Object data)

Checks if a terminal node is the the cause to debug & adds its representation to the rebuilt expression.

Parameters
node:JexlNode

the child node

image:String

the child node token image (may be null)

data:Object

visitor pattern argument

Returns:Object

visitor pattern value

databack to summary
public String data()
Returns:String

The rebuilt expression

databack to summary
public String data(JexlNode node)

Rebuilds an expression from a Jexl node.

Parameters
node:JexlNode

the node to rebuilt from

Returns:String

the rebuilt expression

Since
2.1
debugback to summary
public boolean debug(JexlNode node)

Seeks the location of an error cause (a node) in an expression.

Parameters
node:JexlNode

the node to debug

Returns:boolean

true if the cause was located, false otherwise

endback to summary
public int end()
Returns:int

The end offset location of the cause in the expression

infixChildrenback to summary
private Object infixChildren(JexlNode node, String infix, boolean paren, Object data)

Checks if the children of a node using infix notation is the cause to debug, adds their representation to the rebuilt expression.

Parameters
node:JexlNode

the child node

infix:String

the child node token

paren:boolean

whether the child should be parenthesized

data:Object

visitor pattern argument

Returns:Object

visitor pattern value

prefixChildback to summary
private Object prefixChild(JexlNode node, String prefix, Object data)

Checks if the child of a node using prefix notation is the cause to debug, adds their representation to the rebuilt expression.

Parameters
node:JexlNode

the node

prefix:String

the node token

data:Object

visitor pattern argument

Returns:Object

visitor pattern value

startback to summary
public int start()
Returns:int

The starting offset location of the cause in the expression

visitback to summary
public Object visit(ASTAdditiveNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTAdditiveOperator node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTAndNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTArrayAccess node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTArrayLiteral node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTAssignment node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTBitwiseAndNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTBitwiseComplNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTBitwiseOrNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTBitwiseXorNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTBlock node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTDivNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTEmptyFunction node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTEQNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTERNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTFalseNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTForeachStatement node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTGENode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTGTNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTIdentifier node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTIfStatement node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTNumberLiteral node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTJexlScript node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTLENode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTLTNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTMapEntry node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTMapLiteral node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTConstructorNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTFunctionNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTMethodNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTModNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTMulNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTNENode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTNRNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTNotNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTNullLiteral node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTOrNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTReference node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTReferenceExpression node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTReturnStatement node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTSizeFunction node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTSizeMethod node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTStringLiteral node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTTernaryNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTTrueNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTUnaryMinusNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTVar node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTWhileStatement node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(SimpleNode node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.

visitback to summary
public Object visit(ASTAmbiguous node, Object data)

Implements org.apache.commons.jexl2.parser.ParserVisitor.visit.