Class ExpressionException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.expression.ExpressionException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EvaluationException, ParseException

public class ExpressionException extends RuntimeException
Super class for exceptions that can occur whilst processing expressions.
Since:
3.0
Author:
Andy Clement, Phillip Webb
See Also:
  • Field Details

    • expressionString

      @Nullable protected final String expressionString
    • position

      protected int position
  • Constructor Details

    • ExpressionException

      public ExpressionException(String message)
      Construct a new expression exception.
      Parameters:
      message - a descriptive message
    • ExpressionException

      public ExpressionException(String message, Throwable cause)
      Construct a new expression exception.
      Parameters:
      message - a descriptive message
      cause - the underlying cause of this exception
    • ExpressionException

      public ExpressionException(@Nullable String expressionString, String message)
      Construct a new expression exception.
      Parameters:
      expressionString - the expression string
      message - a descriptive message
    • ExpressionException

      public ExpressionException(@Nullable String expressionString, int position, String message)
      Construct a new expression exception.
      Parameters:
      expressionString - the expression string
      position - the position in the expression string where the problem occurred
      message - a descriptive message
    • ExpressionException

      public ExpressionException(int position, String message)
      Construct a new expression exception.
      Parameters:
      position - the position in the expression string where the problem occurred
      message - a descriptive message
    • ExpressionException

      public ExpressionException(int position, String message, Throwable cause)
      Construct a new expression exception.
      Parameters:
      position - the position in the expression string where the problem occurred
      message - a descriptive message
      cause - the underlying cause of this exception
  • Method Details

    • getExpressionString

      @Nullable public final String getExpressionString()
      Return the expression string.
    • getPosition

      public final int getPosition()
      Return the position in the expression string where the problem occurred.
    • getMessage

      public String getMessage()
      Return the exception message. As of Spring 4.0, this method returns the same result as toDetailedString().
      Overrides:
      getMessage in class Throwable
      See Also:
    • toDetailedString

      public String toDetailedString()
      Return a detailed description of this exception, including the expression String and position (if available) as well as the actual exception message.
    • getSimpleMessage

      public String getSimpleMessage()
      Return the exception simple message without including the expression that caused the failure.
      Since:
      4.0