Class OgnlException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ExpressionSyntaxException, InappropriateExpressionException, MethodFailedException, NoSuchPropertyException

public class OgnlException extends Exception
Superclass for OGNL exceptions, incorporating an optional encapsulated exception.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • _evaluation

      private Evaluation _evaluation
      The root evaluation of the expression when the exception was thrown
  • Constructor Details

    • OgnlException

      public OgnlException()
      Constructs an OgnlException with no message or encapsulated exception.
    • OgnlException

      public OgnlException(String msg)
      Constructs an OgnlException with the given message but no encapsulated exception.
      Parameters:
      msg - the exception's detail message
    • OgnlException

      public OgnlException(String msg, Throwable reason)
      Constructs an OgnlException with the given message and encapsulated exception.
      Parameters:
      msg - the exception's detail message
      reason - the encapsulated exception
    • OgnlException

      protected OgnlException(String message, Throwable reason, boolean enableSuppression, boolean writableStackTrace)
      Constructs an OgnlException with the given message and encapsulated exception, with control on exception suppression and stack trace collection.
      Parameters:
      message - the exception's detail message
      reason - the encapsulated exception
      enableSuppression - whether suppression is enabled or disabled
      writableStackTrace - whether the stack trace should be writable See Throwable(String, Throwable, boolean, boolean) for more info.
  • Method Details

    • getReason

      public Throwable getReason()
      Returns the encapsulated exception, or null if there is none.
      Returns:
      the encapsulated exception
    • getEvaluation

      public Evaluation getEvaluation()
      Returns the Evaluation that was the root evaluation when the exception was thrown.
      Returns:
      The Evaluation.
    • setEvaluation

      public void setEvaluation(Evaluation value)
      Sets the Evaluation that was current when this exception was thrown.
      Parameters:
      value - The Evaluation.
    • toString

      public String toString()
      Returns a string representation of this exception.
      Overrides:
      toString in class Throwable
      Returns:
      a string representation of this exception