Package org.springframework.expression
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:
- Serialized Form
Field Summary
Fields Modifier and Type Field Description protected String
expressionString
protected int
position
Constructor Summary
Constructors Constructor Description ExpressionException(int position, String message)
Construct a new expression exception.ExpressionException(int position, String message, Throwable cause)
Construct a new expression exception.ExpressionException(String message)
Construct a new expression exception.ExpressionException(String expressionString, int position, String message)
Construct a new expression exception.ExpressionException(String expressionString, String message)
Construct a new expression exception.ExpressionException(String message, Throwable cause)
Construct a new expression exception.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getExpressionString()
Return the expression string.String
getMessage()
Return the exception message.int
getPosition()
Return the position in the expression string where the problem occurred.String
getSimpleMessage()
Return the exception simple message without including the expression that caused the failure.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
Field Detail
expressionString
@Nullable protected final String expressionString
position
protected int position
Constructor Detail
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 messagecause
- the underlying cause of this exception
ExpressionException
public ExpressionException(@Nullable String expressionString, String message)
Construct a new expression exception.- Parameters:
expressionString
- the expression stringmessage
- a descriptive message
ExpressionException
public ExpressionException(@Nullable String expressionString, int position, String message)
Construct a new expression exception.- Parameters:
expressionString
- the expression stringposition
- the position in the expression string where the problem occurredmessage
- 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 occurredmessage
- 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 occurredmessage
- a descriptive messagecause
- the underlying cause of this exception
Method Detail
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 astoDetailedString()
.- Overrides:
getMessage
in classThrowable
- See Also:
getSimpleMessage()
,Throwable.getMessage()
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