Class JexlException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.apache.commons.jexl2.JexlException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
JexlException.Cancel, JexlException.Method, JexlException.Parsing, JexlException.Property, JexlException.Return, JexlException.Tokenization, JexlException.Variable
Wraps any error that might occur during interpretation of a script or expression.
- Since:
- 2.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classThrown to cancel a script execution.static classThrown when a method or ctor is unknown, ambiguous or inaccessible.static classThrown when parsing fails.static classThrown when a property is unknown.protected static classThrown to return a value.static classThrown when tokenization fails.static classThrown when a variable is unknown. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJexlException(JexlInfo dbg, String msg) Creates a new JexlException.JexlException(JexlInfo dbg, String msg, Throwable cause) Creates a new JexlException.JexlException(JexlNode node, String msg) Creates a new JexlException.JexlException(JexlNode node, String msg, Throwable cause) Creates a new JexlException. -
Method Summary
Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
mark
-
info
-
NULL_OPERAND
A marker to use in NPEs stating a null operand error.- See Also:
-
-
Constructor Details
-
JexlException
Creates a new JexlException.- Parameters:
node- the node causing the errormsg- the error message
-
JexlException
Creates a new JexlException.- Parameters:
node- the node causing the errormsg- the error messagecause- the exception causing the error
-
JexlException
Creates a new JexlException.- Parameters:
dbg- the debugging information associatedmsg- the error message
-
JexlException
Creates a new JexlException.- Parameters:
dbg- the debugging information associatedmsg- the error messagecause- the exception causing the error
-
-
Method Details
-
detailedMessage
-
parserError
Formats an error message from the parser.- Parameters:
prefix- the prefix to the messageexpr- the expression in error- Returns:
- the formatted message
- Since:
- 2.1
-
getInfo
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- character offset interval of the precise node triggering the error- Returns:
- a string representation of the offending expression, the empty string if it could not be determined
-
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- Overrides:
getMessagein classThrowable- Returns:
- this error as a string
-