Class ErrorMessage

java.lang.Object
org.apache.commons.digester3.binder.ErrorMessage

final class ErrorMessage extends Object
An error message and the context in which it occurred. Messages are usually created internally by Digester and its extensions. Messages can be created explicitly in a module using addError() statement:
try {
   bindRulesFromFile();
 } catch (IOException e) {
   addError(e);
 }
  • Field Details

    • message

      private final String message
      The error message text.
    • cause

      private final Throwable cause
      The throwable that caused this message.
  • Constructor Details

    • ErrorMessage

      public ErrorMessage(String messagePattern, Object... arguments)
      Create a new ErrorMessage instance from the error message text.
      Parameters:
      messagePattern - The error message text pattern
      arguments - Arguments referenced by the format specifiers in the format string
    • ErrorMessage

      public ErrorMessage(String message, Throwable cause)
      Create a new ErrorMessage instance from the error message text and the related cause.
      Parameters:
      message - The error message text
      cause - The throwable that caused this message
  • Method Details

    • getMessage

      public String getMessage()
      Gets the error message text.
      Returns:
      The error message text
    • getCause

      public Throwable getCause()
      Returns the Throwable that caused this message, or null 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 String toString()
      Overrides:
      toString in class Object