org.springframework.expression

Class ExpressionException

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


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

      Fields 
      Modifier and Type Field and Description
      protected java.lang.String expressionString 
      protected int position 
    • Constructor Summary

      Constructors 
      Constructor and Description
      ExpressionException(int position, java.lang.String message)
      Construct a new expression exception.
      ExpressionException(int position, java.lang.String message, java.lang.Throwable cause)
      Construct a new expression exception.
      ExpressionException(java.lang.String message)
      Construct a new expression exception.
      ExpressionException(java.lang.String expressionString, int position, java.lang.String message)
      Construct a new expression exception.
      ExpressionException(java.lang.String expressionString, java.lang.String message)
      Construct a new expression exception.
      ExpressionException(java.lang.String message, java.lang.Throwable cause)
      Construct a new expression exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getExpressionString()
      Return the expression string.
      java.lang.String getMessage()
      Return the exception message.
      int getPosition()
      Return the position in the expression string where the problem occurred.
      java.lang.String getSimpleMessage()
      Return the exception simple message without including the expression that caused the failure.
      java.lang.String toDetailedString()
      Return a detailed description of this exception, including the expression String and position (if available) as well as the actual exception message.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, 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

      • expressionString

        @Nullable
        protected final java.lang.String expressionString
      • position

        protected int position
    • Constructor Detail

      • ExpressionException

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

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

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

        public ExpressionException(@Nullable
                                   java.lang.String expressionString,
                                   int position,
                                   java.lang.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,
                                   java.lang.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,
                                   java.lang.String message,
                                   java.lang.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 Detail

      • getExpressionString

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

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

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

        public java.lang.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 java.lang.String getSimpleMessage()
        Return the exception simple message without including the expression that caused the failure.
        Since:
        4.0