com.pdfunit.messages

## Class AbstractPDFUnitMessage

- java.lang.Object
- - com.pdfunit.messages.AbstractPDFUnitMessage

- All Implemented Interfaces:
    IPDFUnitMessage
  Direct Known Subclasses:
    AllDocumentsFilteredOutMessage, CollectedConstraintsMessage, CollectedExceptionsMessage, ConstraintCellNotNumericMessage, ConstraintEmptyRegionIDMessage, ConstraintExpectedValueEmptyMessage, ConstraintExpectedValueNotEmptyMessage, ConstraintFileDin5008Message, ConstraintIDAvailableMessage, ConstraintInvalidHeightMessage, ConstraintInvalidPageValueMessage, ConstraintInvalidTypeMessage, ConstraintInvalidWhitespaceMessage, ConstraintInvalidWidthMessage, ConstraintNegativeXValueMessage, ConstraintNegativeYValueMessage, ConstraintNoSheetForRegionDefinitionsFoundMessage, ConstraintNotAvailableMessage, ConstraintRegionNameNotFoundMessage, ConstraintUnhandledCellTypeMessage, DestinationOnPageMessage, GeneralEqualsHashcodeMessage, GeneralExceptionReadingConfigFileMessage, GeneralInvalidQuotesMessage, GeneralIOExceptionDestinationMessage, GeneralIOExceptionFontsMessage, GeneralIOExceptionJavaScriptMessage, GeneralIOExceptionLoadNamedDocumentMessage, GeneralIOExceptionLoadUnnamedDocumentMessage, GeneralIOExceptionReadFileMessage, GeneralIOExceptionReadImageFromPDFMessage, GeneralIOExceptionReadStreamMessage, GeneralIOExceptionRenderPageMessage, GeneralIOExceptionSignaturesMessage, GeneralIOExceptionWriteDiffImageMessage, GeneralReadFileMessage, GeneralRegexParsingMessage, GeneralXMLProcessingMessage, GeneralXPathMessage, GeneralXPathResultTypeMessage, ImageRegionValuesMessage, InvalidArgumentEmptyArrayMessage, InvalidArgumentEmptyStringMessage, InvalidArgumentIntNegativeMessage, InvalidArgumentIntNotPositiveMessage, InvalidArgumentParameterNullMessage, NoDocumentGivenMessage, NumberFormatMessage, PageNumberLowerBoundGreaterUpperBoundMessage, PageNumberTooLowMessage, PDFAAnalysingNotSupportedForStreamsMessage, PDFUnitRuleMessage, RegionOutsidePageMessage, RequestedPagenumberTooHigh, SingleDocumentMessage, TagValueTypeNotSupport

      @DoNotObfuscate
      public abstract class AbstractPDFUnitMessage
      extends java.lang.Object
      implements IPDFUnitMessage

  Superclass for all message classes.

  This class holds all data of a message and the formatting method. The formatting uses the file messages.properties as a ResourceBundle with the name of the concrete class as the key.

  This class contains also a shutdown-hook, which logs all messages to stdout. That makes it possible to check the correctness of the formatted messages.

  Since:
    2013.01
  Author:
    Carsten Siedentop, January 2013

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractPDFUnitMessage(java.lang.Class<? extends AbstractPDFUnitMessage> msgClass)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addParam(java.lang.String param)` Adding a message parameter to the message instance.
    `java.lang.String` | `getMessage()` Returning the formatted method.
    `void` | `logForDevelopment()` This method allowes to log all messages to an output stream for further analysis during develoment.
    `protected java.lang.String` | `shortenName(java.lang.String longName)` Take some bytes from start and some bytes from end.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractPDFUnitMessage

          protected AbstractPDFUnitMessage(java.lang.Class<? extends AbstractPDFUnitMessage> msgClass)

  - ### Method Detail

    - #### getMessage

          public java.lang.String getMessage()

      Description copied from interface: `IPDFUnitMessage`
      Returning the formatted method. The method itself comes from the file 'messages.properties'. The key is the name of each subclass of this interface.
      Specified by:
        `getMessage` in interface `IPDFUnitMessage`

    - #### addParam

          public void addParam(java.lang.String param)

      Description copied from interface: `IPDFUnitMessage`
      Adding a message parameter to the message instance.
      Specified by:
        `addParam` in interface `IPDFUnitMessage`

    - #### logForDevelopment

          public void logForDevelopment()

      Description copied from interface: `IPDFUnitMessage`
      This method allowes to log all messages to an output stream for further analysis during develoment.
      Specified by:
        `logForDevelopment` in interface `IPDFUnitMessage`

    - #### shortenName

          protected java.lang.String shortenName(java.lang.String longName)

      Take some bytes from start and some bytes from end. Replace the middle by an elipsis.

Copyright (C) PDFUnit.com. See here for license.