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

public Class JexlException

extends RuntimeException
Class Inheritance
Known Direct Subclasses
org.apache.commons.jexl2.JexlException.Tokenization, org.apache.commons.jexl2.JexlException.Parsing, org.apache.commons.jexl2.JexlException.Variable, org.apache.commons.jexl2.JexlException.Property, org.apache.commons.jexl2.JexlException.Method, org.apache.commons.jexl2.JexlException.Return, org.apache.commons.jexl2.JexlException.Cancel
Imports
java.lang.reflect.InvocationTargetException, .UndeclaredThrowableException, org.apache.commons.jexl2.parser.JexlNode, .ParseException, .TokenMgrError

Wraps any error that might occur during interpretation of a script or expression.
Since
2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
JexlException.Cancel

Thrown to cancel a script execution.

public static class
JexlException.Method

Thrown when a method or ctor is unknown, ambiguous or inaccessible.

public static class
JexlException.Parsing

Thrown when parsing fails.

public static class
JexlException.Property

Thrown when a property is unknown.

protected static class
JexlException.Return

Thrown to return a value.

public static class
JexlException.Tokenization

Thrown when tokenization fails.

public static class
JexlException.Variable

Thrown when a variable is unknown.

Field Summary

Modifier and TypeField and Description
protected final transient JexlInfo
info

The debug info.

protected final transient JexlNode
mark

The point of origin for this exception.

private static final int
MAX_EXCHARLOC

Maximum number of characters around exception location.

private static final int
MIN_EXCHARLOC

Minimum number of characters around exception location.

public static final String
NULL_OPERAND

A marker to use in NPEs stating a null operand error.

Constructor Summary

AccessConstructor and Description
public
JexlException(JexlNode
the node causing the error
node
,
String
the error message
msg
)

Creates a new JexlException.

public
JexlException(JexlNode
the node causing the error
node
,
String
the error message
msg
,
Throwable
the exception causing the error
cause
)

Creates a new JexlException.

public
JexlException(JexlInfo
the debugging information associated
dbg
,
String
the error message
msg
)

Creates a new JexlException.

public
JexlException(JexlInfo
the debugging information associated
dbg
,
String
the error message
msg
,
Throwable
the exception causing the error
cause
)

Creates a new JexlException.

Method Summary

Modifier and TypeMethod and Description
protected String

Returns:

the message
detailedMessage
()

Accesses detailed message.

public String

Returns:

a string representation of the offending expression, the empty string if it could not be determined
getInfo
(int[]
character offset interval of the precise node triggering the error
offsets
)

Gets information about the cause of this error.

public String

Returns:

this error as a string
getMessage
()

Overrides java.lang.Throwable.getMessage.

Detailed info message about this error.
protected String

Returns:

the formatted message
parserError
(String
the prefix to the message
prefix
,
String
the expression in error
expr
)

Formats an error message from the parser.

private static Throwable

Returns:

the cause
unwrap
(Throwable
the throwable
xthrow
)

Unwraps the cause of a throwable due to reflection.

Field Detail

infoback to summary
protected final transient JexlInfo info

The debug info.

markback to summary
protected final transient JexlNode mark

The point of origin for this exception.

MAX_EXCHARLOCback to summary
private static final int MAX_EXCHARLOC

Maximum number of characters around exception location.

MIN_EXCHARLOCback to summary
private static final int MIN_EXCHARLOC

Minimum number of characters around exception location.

NULL_OPERANDback to summary
public static final String NULL_OPERAND

A marker to use in NPEs stating a null operand error.

Constructor Detail

JexlExceptionback to summary
public JexlException(JexlNode node, String msg)

Creates a new JexlException.

Parameters
node:JexlNode

the node causing the error

msg:String

the error message

JexlExceptionback to summary
public JexlException(JexlNode node, String msg, Throwable cause)

Creates a new JexlException.

Parameters
node:JexlNode

the node causing the error

msg:String

the error message

cause:Throwable

the exception causing the error

JexlExceptionback to summary
public JexlException(JexlInfo dbg, String msg)

Creates a new JexlException.

Parameters
dbg:JexlInfo

the debugging information associated

msg:String

the error message

JexlExceptionback to summary
public JexlException(JexlInfo dbg, String msg, Throwable cause)

Creates a new JexlException.

Parameters
dbg:JexlInfo

the debugging information associated

msg:String

the error message

cause:Throwable

the exception causing the error

Method Detail

detailedMessageback to summary
protected String detailedMessage()

Accesses detailed message.

Returns:String

the message

Since
2.1
getInfoback to summary
public String getInfo(int[] offsets)

Gets information about the cause of this error.

The returned string represents the outermost expression in error. The info parameter, an int[2] optionally provided by the caller, will be filled with the begin/end offset characters of the precise error's trigger.

Parameters
offsets:int[]

character offset interval of the precise node triggering the error

Returns:String

a string representation of the offending expression, the empty string if it could not be determined

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Detailed info message about this error. Format is "debug![begin,end]: string \n msg" where: - debug is the debugging information if it exists (@link JexlEngine.setDebug) - begin, end are character offsets in the string for the precise location of the error - string is the string representation of the offending expression - msg is the actual explanation message for this error

Returns:String

this error as a string

Annotations
@Override
parserErrorback to summary
protected String parserError(String prefix, String expr)

Formats an error message from the parser.

Parameters
prefix:String

the prefix to the message

expr:String

the expression in error

Returns:String

the formatted message

Since
2.1
unwrapback to summary
private static Throwable unwrap(Throwable xthrow)

Unwraps the cause of a throwable due to reflection.

Parameters
xthrow:Throwable

the throwable

Returns:Throwable

the cause

org.apache.commons.jexl2 back to summary

protected Class JexlException.Cancel

extends JexlException
Class Inheritance

Thrown to cancel a script execution.
Since
2.1

Field Summary

Inherited from org.apache.commons.jexl2.JexlException:
infomarkNULL_OPERAND

Constructor Summary

AccessConstructor and Description
protected
Cancel(JexlNode
the node where the interruption was detected
node
)

Creates a new instance of Cancel.

Method Summary

Inherited from org.apache.commons.jexl2.JexlException:
detailedMessagegetInfogetMessageparserError

Constructor Detail

Cancelback to summary
protected Cancel(JexlNode node)

Creates a new instance of Cancel.

Parameters
node:JexlNode

the node where the interruption was detected

org.apache.commons.jexl2 back to summary

public Class JexlException.Method

extends JexlException
Class Inheritance

Thrown when a method or ctor is unknown, ambiguous or inaccessible.
Since
2.1

Field Summary

Inherited from org.apache.commons.jexl2.JexlException:
infomarkNULL_OPERAND

Constructor Summary

AccessConstructor and Description
public
Method(JexlNode
the offending ASTnode
node
,
String
the unknown method
name
)

Creates a new Method exception instance.

Method Summary

Modifier and TypeMethod and Description
protected String
public String

Returns:

the method name
getMethod
()

Inherited from org.apache.commons.jexl2.JexlException:
getInfogetMessageparserError

Constructor Detail

Methodback to summary
public Method(JexlNode node, String name)

Creates a new Method exception instance.

Parameters
node:JexlNode

the offending ASTnode

name:String

the unknown method

Method Detail

detailedMessageback to summary
protected String detailedMessage()

Overrides org.apache.commons.jexl2.JexlException.detailedMessage.

Doc from org.apache.commons.jexl2.JexlException.detailedMessage.

Accesses detailed message.

Returns:String

the message

Annotations
@Override
getMethodback to summary
public String getMethod()
Returns:String

the method name

org.apache.commons.jexl2 back to summary

public Class JexlException.Parsing

extends JexlException
Class Inheritance

Thrown when parsing fails.
Since
2.1

Field Summary

Inherited from org.apache.commons.jexl2.JexlException:
infomarkNULL_OPERAND

Constructor Summary

AccessConstructor and Description
public
Parsing(JexlInfo
the offending ASTnode
node
,
CharSequence
the offending source
expr
,
ParseException
the javacc cause
cause
)

Creates a new Variable exception instance.

Method Summary

Modifier and TypeMethod and Description
protected String
public String

Returns:

the expression
getExpression
()

private static DebugInfo

Returns:

the info to use
merge
(JexlInfo
the node
node
,
ParseException
the cause
cause
)

Merge the node info and the cause info to obtain best possible location.

Inherited from org.apache.commons.jexl2.JexlException:
getInfogetMessageparserError

Constructor Detail

Parsingback to summary
public Parsing(JexlInfo node, CharSequence expr, ParseException cause)

Creates a new Variable exception instance.

Parameters
node:JexlInfo

the offending ASTnode

expr:CharSequence

the offending source

cause:ParseException

the javacc cause

Method Detail

detailedMessageback to summary
protected String detailedMessage()

Overrides org.apache.commons.jexl2.JexlException.detailedMessage.

Doc from org.apache.commons.jexl2.JexlException.detailedMessage.

Accesses detailed message.

Returns:String

the message

Annotations
@Override
getExpressionback to summary
public String getExpression()
Returns:String

the expression

mergeback to summary
private static DebugInfo merge(JexlInfo node, ParseException cause)

Merge the node info and the cause info to obtain best possible location.

Parameters
node:JexlInfo

the node

cause:ParseException

the cause

Returns:DebugInfo

the info to use

org.apache.commons.jexl2 back to summary

public Class JexlException.Property

extends JexlException
Class Inheritance

Thrown when a property is unknown.
Since
2.1

Field Summary

Inherited from org.apache.commons.jexl2.JexlException:
infomarkNULL_OPERAND

Constructor Summary

AccessConstructor and Description
public
Property(JexlNode
the offending ASTnode
node
,
String
the unknown variable
var
)

Creates a new Property exception instance.

Method Summary

Modifier and TypeMethod and Description
protected String
public String

Returns:

the property name
getProperty
()

Inherited from org.apache.commons.jexl2.JexlException:
getInfogetMessageparserError

Constructor Detail

Propertyback to summary
public Property(JexlNode node, String var)

Creates a new Property exception instance.

Parameters
node:JexlNode

the offending ASTnode

var:String

the unknown variable

Method Detail

detailedMessageback to summary
protected String detailedMessage()

Overrides org.apache.commons.jexl2.JexlException.detailedMessage.

Doc from org.apache.commons.jexl2.JexlException.detailedMessage.

Accesses detailed message.

Returns:String

the message

Annotations
@Override
getPropertyback to summary
public String getProperty()
Returns:String

the property name

org.apache.commons.jexl2 back to summary

protected Class JexlException.Return

extends JexlException
Class Inheritance

Thrown to return a value.
Since
2.1

Field Summary

Modifier and TypeField and Description
private final Object
result

The returned value.

Inherited from org.apache.commons.jexl2.JexlException:
infomarkNULL_OPERAND

Constructor Summary

AccessConstructor and Description
protected
Return(JexlNode
the return node
node
,
String
the message
msg
,
Object
the returned value
value
)

Creates a new instance of Return.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the returned value
getValue
()

Inherited from org.apache.commons.jexl2.JexlException:
detailedMessagegetInfogetMessageparserError

Field Detail

resultback to summary
private final Object result

The returned value.

Constructor Detail

Returnback to summary
protected Return(JexlNode node, String msg, Object value)

Creates a new instance of Return.

Parameters
node:JexlNode

the return node

msg:String

the message

value:Object

the returned value

Method Detail

getValueback to summary
public Object getValue()
Returns:Object

the returned value

org.apache.commons.jexl2 back to summary

public Class JexlException.Tokenization

extends JexlException
Class Inheritance

Thrown when tokenization fails.
Since
2.1

Field Summary

Inherited from org.apache.commons.jexl2.JexlException:
infomarkNULL_OPERAND

Constructor Summary

AccessConstructor and Description
public
Tokenization(JexlInfo
the location info
node
,
CharSequence
the expression
expr
,
TokenMgrError
the javacc cause
cause
)

Creates a new Tokenization exception instance.

Method Summary

Modifier and TypeMethod and Description
protected String
public String

Returns:

the expression
getExpression
()

private static DebugInfo

Returns:

the info to use
merge
(JexlInfo
the node
node
,
TokenMgrError
the cause
cause
)

Merge the node info and the cause info to obtain best possible location.

Inherited from org.apache.commons.jexl2.JexlException:
getInfogetMessageparserError

Constructor Detail

Tokenizationback to summary
public Tokenization(JexlInfo node, CharSequence expr, TokenMgrError cause)

Creates a new Tokenization exception instance.

Parameters
node:JexlInfo

the location info

expr:CharSequence

the expression

cause:TokenMgrError

the javacc cause

Method Detail

detailedMessageback to summary
protected String detailedMessage()

Overrides org.apache.commons.jexl2.JexlException.detailedMessage.

Doc from org.apache.commons.jexl2.JexlException.detailedMessage.

Accesses detailed message.

Returns:String

the message

Annotations
@Override
getExpressionback to summary
public String getExpression()
Returns:String

the expression

mergeback to summary
private static DebugInfo merge(JexlInfo node, TokenMgrError cause)

Merge the node info and the cause info to obtain best possible location.

Parameters
node:JexlInfo

the node

cause:TokenMgrError

the cause

Returns:DebugInfo

the info to use

org.apache.commons.jexl2 back to summary

public Class JexlException.Variable

extends JexlException
Class Inheritance

Thrown when a variable is unknown.
Since
2.1

Field Summary

Inherited from org.apache.commons.jexl2.JexlException:
infomarkNULL_OPERAND

Constructor Summary

AccessConstructor and Description
public
Variable(JexlNode
the offending ASTnode
node
,
String
the unknown variable
var
)

Creates a new Variable exception instance.

Method Summary

Modifier and TypeMethod and Description
protected String
public String

Returns:

the variable name
getVariable
()

Inherited from org.apache.commons.jexl2.JexlException:
getInfogetMessageparserError

Constructor Detail

Variableback to summary
public Variable(JexlNode node, String var)

Creates a new Variable exception instance.

Parameters
node:JexlNode

the offending ASTnode

var:String

the unknown variable

Method Detail

detailedMessageback to summary
protected String detailedMessage()

Overrides org.apache.commons.jexl2.JexlException.detailedMessage.

Doc from org.apache.commons.jexl2.JexlException.detailedMessage.

Accesses detailed message.

Returns:String

the message

Annotations
@Override
getVariableback to summary
public String getVariable()
Returns:String

the variable name