org.apache.commons.jexl2
Class JexlException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.apache.commons.jexl2.JexlException
All Implemented Interfaces:
java.io.Serializable

public class JexlException
extends java.lang.RuntimeException

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

Since:
2.0
See Also:
Serialized Form

Field Summary
protected  JexlInfo info
          The debug info.
protected  JexlNode mark
          The point of origin for this exception.
static java.lang.String NULL_OPERAND
          A marker to use in NPEs stating a null operand error.
 
Constructor Summary
JexlException(JexlInfo dbg, java.lang.String msg)
          Creates a new JexlException.
JexlException(JexlInfo dbg, java.lang.String msg, java.lang.Throwable cause)
          Creates a new JexlException.
JexlException(JexlNode node, java.lang.String msg)
          Creates a new JexlException.
JexlException(JexlNode node, java.lang.String msg, java.lang.Throwable cause)
          Creates a new JexlException.
 
Method Summary
 java.lang.String getInfo(int[] offsets)
          Gets information about the cause of this error.
 java.lang.String getMessage()
          Detailed info message about this error.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mark

protected final JexlNode mark
The point of origin for this exception.


info

protected final JexlInfo info
The debug info.


NULL_OPERAND

public static final java.lang.String NULL_OPERAND
A marker to use in NPEs stating a null operand error.

See Also:
Constant Field Values
Constructor Detail

JexlException

public JexlException(JexlNode node,
                     java.lang.String msg)
Creates a new JexlException.

Parameters:
node - the node causing the error
msg - the error message

JexlException

public JexlException(JexlNode node,
                     java.lang.String msg,
                     java.lang.Throwable cause)
Creates a new JexlException.

Parameters:
node - the node causing the error
msg - the error message
cause - the exception causing the error

JexlException

public JexlException(JexlInfo dbg,
                     java.lang.String msg)
Creates a new JexlException.

Parameters:
dbg - the debugging information associated
msg - the error message

JexlException

public JexlException(JexlInfo dbg,
                     java.lang.String msg,
                     java.lang.Throwable cause)
Creates a new JexlException.

Parameters:
dbg - the debugging information associated
msg - the error message
cause - the exception causing the error
Method Detail

getInfo

public java.lang.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 - 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

public java.lang.String 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:
getMessage in class java.lang.Throwable
Returns:
this error as a string


Copyright © 2001-2010 Apache Software Foundation. All Rights Reserved.