Interface DocumentOutput

All Known Implementing Classes:
CachedOutput, DocumentOutputStream

public interface DocumentOutput
Instances of this interface store the rendered data (pages, chunks, fonts, etc ) of a report.
Since:
16.2
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addFontData(byte[] fontData)
    Add the data for an embedded font.
    void
    addPage(byte @Nonnull [] page)
    Add a page/chunk.
    void
    Reset this output in the initial state.
    int
    Get the count of added fonts.
    byte @Nonnull []
    getFontData(int idx)
    Get the font data from the given index.
    byte[]
    Get the data of the group tree.
    int
    Get the current count of pages.
    byte @Nonnull []
    getPageData(int idx)
    Get the binary data of a page/chunk.
    boolean
    Check if the rendering of the report ran into a page limit.
    void
    setErrorData(byte[] error)
    Set error data.
    void
    setFontData(byte[] fontData, int idx)
    Override the font data with a new version.
    void
    setGroupTree(byte @Nonnull [] data)
    Set the group tree.
    void
    setPageData(byte @Nonnull [] page, int idx)
    Override/patched an existing page/chunk.
    void
    Set that a PageLimitException exception occur.
    void
    Set that a total page is used in the report.
    void
    stop(@Nullable String cause)
    The rendering was stopped.
  • Method Details

    • getPageCount

      int getPageCount()
      Get the current count of pages.
      Returns:
      the page count
      Since:
      16.2
    • clear

      void clear()
      Reset this output in the initial state. So getPageCount() == 0 and getFontCount() == 0.
      Since:
      16.2
    • getPageData

      byte @Nonnull [] getPageData(int idx) throws ArrayIndexOutOfBoundsException
      Get the binary data of a page/chunk.
      Parameters:
      idx - the index, starts with 1
      Returns:
      the data, never null
      Throws:
      ArrayIndexOutOfBoundsException - if index is out of range
      Since:
      16.2
    • getGroupTree

      byte[] getGroupTree()
      Get the data of the group tree.
      Returns:
      Can be null, if not set.
      Since:
      16.2
    • addPage

      void addPage(byte @Nonnull [] page) throws IllegalStateException
      Add a page/chunk. Increment getPageCount()
      Parameters:
      page - the binary data, never null
      Throws:
      IllegalStateException - if this output is finish or stopped.
      Since:
      16.2
    • setPageData

      void setPageData(byte @Nonnull [] page, int idx) throws IllegalStateException
      Override/patched an existing page/chunk.
      Parameters:
      page - die binary data, never null
      idx - the index, starts with 1
      Throws:
      IllegalStateException - if this output is finish or stopped.
      Since:
      16.2
    • setGroupTree

      void setGroupTree(byte @Nonnull [] data) throws IllegalStateException
      Set the group tree. After this call this output is finish and any try to change this object should throw an exception. This call does not change getPageCount().
      Parameters:
      data - the binary data, never null, but can be an empty array
      Throws:
      IllegalStateException - if this output is finish or stopped.
      Since:
      16.2
    • setErrorData

      void setErrorData(byte[] error) throws IllegalStateException
      Set error data. After this call this output is finish and any try to change this object should throw an exception.
      Parameters:
      error - serialized Exception
      Throws:
      IllegalStateException - if this output is finish or stopped.
      Since:
      16.2
    • stop

      void stop(@Nullable @Nullable String cause)
      The rendering was stopped. This is called from Engine.stop(). After this call any try to change this object should throw an exception.
      Parameters:
      cause - an optional message
      Since:
      16.2
    • addFontData

      void addFontData(byte[] fontData) throws IllegalStateException
      Add the data for an embedded font. Increment getFontCount(). This method is only used from the Java/C# output format.
      Parameters:
      fontData - binary data in the current protocol format.
      Throws:
      IllegalStateException - if this output is finish or stopped.
      Since:
      16.2
    • setFontData

      void setFontData(byte[] fontData, int idx) throws IllegalStateException
      Override the font data with a new version.
      Parameters:
      fontData - binary data in the current protocol format.
      idx - the index, starts with 0
      Throws:
      IllegalStateException - if this output is finish or stopped.
      Since:
      16.2
    • getFontData

      byte @Nonnull [] getFontData(int idx) throws ArrayIndexOutOfBoundsException
      Get the font data from the given index.
      Parameters:
      idx - the index, starts with 0
      Returns:
      the font data, never null
      Throws:
      ArrayIndexOutOfBoundsException - if index is out of range
      Since:
      16.2
    • getFontCount

      int getFontCount()
      Get the count of added fonts.
      Returns:
      the font count
      Since:
      16.2
    • setPageLimitExceeded

      void setPageLimitExceeded()
      Set that a PageLimitException exception occur.
      Since:
      16.2
    • isPageLimitExceeded

      boolean isPageLimitExceeded()
      Check if the rendering of the report ran into a page limit. This means does not all possible pages exist.
      Returns:
      true, if PageLimitException was occur
      Since:
      16.2
    • setUsingTotalPage

      void setUsingTotalPage()
      Set that a total page is used in the report.
      Since:
      16.2