Package ognl
Class OgnlException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- ognl.OgnlException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ExpressionSyntaxException
,InappropriateExpressionException
,MethodFailedException
,NoSuchPropertyException
public class OgnlException extends java.lang.Exception
Superclass for OGNL exceptions, incorporating an optional encapsulated exception.- Author:
- Luke Blanshard (blanshlu@netscape.net), Drew Davidson (drew@ognl.org)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OgnlException()
Constructs an OgnlException with no message or encapsulated exception.OgnlException(java.lang.String msg)
Constructs an OgnlException with the given message but no encapsulated exception.OgnlException(java.lang.String msg, java.lang.Throwable reason)
Constructs an OgnlException with the given message and encapsulated exception.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Evaluation
getEvaluation()
Returns the Evaluation that was the root evaluation when the exception was thrown.java.lang.Throwable
getReason()
Returns the encapsulated exception, or null if there is none.void
printStackTrace()
Prints the stack trace for this (and possibly the encapsulated) exception on System.err.void
printStackTrace(java.io.PrintStream s)
Prints the stack trace for this (and possibly the encapsulated) exception on the given print stream.void
printStackTrace(java.io.PrintWriter s)
Prints the stack trace for this (and possibly the encapsulated) exception on the given print writer.void
setEvaluation(Evaluation value)
Sets the Evaluation that was current when this exception was thrown.java.lang.String
toString()
Returns a string representation of this exception.
-
-
-
Constructor Detail
-
OgnlException
public OgnlException()
Constructs an OgnlException with no message or encapsulated exception.
-
OgnlException
public OgnlException(java.lang.String msg)
Constructs an OgnlException with the given message but no encapsulated exception.- Parameters:
msg
- the exception's detail message
-
OgnlException
public OgnlException(java.lang.String msg, java.lang.Throwable reason)
Constructs an OgnlException with the given message and encapsulated exception.- Parameters:
msg
- the exception's detail messagereason
- the encapsulated exception
-
-
Method Detail
-
getReason
public java.lang.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
- TheEvaluation
.
-
toString
public java.lang.String toString()
Returns a string representation of this exception.- Overrides:
toString
in classjava.lang.Throwable
- Returns:
- a string representation of this exception
-
printStackTrace
public void printStackTrace()
Prints the stack trace for this (and possibly the encapsulated) exception on System.err.- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
Prints the stack trace for this (and possibly the encapsulated) exception on the given print stream.- Overrides:
printStackTrace
in classjava.lang.Throwable
-
printStackTrace
public void printStackTrace(java.io.PrintWriter s)
Prints the stack trace for this (and possibly the encapsulated) exception on the given print writer.- Overrides:
printStackTrace
in classjava.lang.Throwable
-
-