Class ErrorMessage


  • final class ErrorMessage
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Throwable cause
      The throwable that caused this message.
      private java.lang.String message
      The error message text.
    • Constructor Summary

      Constructors 
      Constructor Description
      ErrorMessage​(java.lang.String messagePattern, java.lang.Object... arguments)
      Create a new ErrorMessage instance from the error message text.
      ErrorMessage​(java.lang.String message, java.lang.Throwable cause)
      Create a new ErrorMessage 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, or null if this message was not caused by a Throwable.
      java.lang.String getMessage()
      Gets the error message text.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • message

        private final java.lang.String message
        The error message text.
      • cause

        private final java.lang.Throwable cause
        The throwable that caused this message.
    • Constructor Detail

      • ErrorMessage

        public ErrorMessage​(java.lang.String messagePattern,
                            java.lang.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​(java.lang.String message,
                            java.lang.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 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, 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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object