Class ErrorMessage
- java.lang.Object
-
- org.apache.commons.digester3.binder.ErrorMessage
-
final class ErrorMessage extends java.lang.Object
An error message and the context in which it occurred. Messages are usually created internally byDigester
and its extensions. Messages can be created explicitly in a module usingaddError()
statement:try { bindRulesFromFile(); } catch (IOException e) { addError(e); }
-
-
Constructor Summary
Constructors Constructor Description ErrorMessage(java.lang.String messagePattern, java.lang.Object... arguments)
Create a newErrorMessage
instance from the error message text.ErrorMessage(java.lang.String message, java.lang.Throwable cause)
Create a newErrorMessage
instance from the error message text and the related cause.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
getCause()
Returns the Throwable that caused this message, ornull
if this message was not caused by a Throwable.java.lang.String
getMessage()
Gets the error message text.java.lang.String
toString()
-
-
-
Constructor Detail
-
ErrorMessage
public ErrorMessage(java.lang.String messagePattern, java.lang.Object... arguments)
Create a newErrorMessage
instance from the error message text.- Parameters:
messagePattern
- The error message text patternarguments
- Arguments referenced by the format specifiers in the format string
-
ErrorMessage
public ErrorMessage(java.lang.String message, java.lang.Throwable cause)
Create a newErrorMessage
instance from the error message text and the related cause.- Parameters:
message
- The error message textcause
- The throwable that caused this message
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
Gets the error message text.- Returns:
- The error message text
-
getCause
public java.lang.Throwable getCause()
Returns the Throwable that caused this message, ornull
if this message was not caused by a Throwable.- Returns:
- The Throwable that caused this message, or
null
if this message was not caused by a Throwable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-