com.groupdocs.parser

Interfaces

Classes

Exceptions

com.groupdocs.parser

Class DocumentPartFormatter<T>

  • Direct Known Subclasses:
    ListFormatter, TableFormatter, TextFormatter


    public abstract class DocumentPartFormatter<T>
    extends Object

    Provides the functionality for formatting a part of a document.

    T: The type of a document's part.

    • Constructor Detail

      • DocumentPartFormatter

        public DocumentPartFormatter()
    • Method Detail

      • isEmpty

        public boolean isEmpty()

        Gets a value indicating whether the formatter is empty.

        Returns:
        A boolean true if the formatter is empty; otherwise, false.
      • getPreviousItem

        protected T getPreviousItem()

        Gets the previous formatted item.

        Returns:
        The previous formatted item.
      • getPreviousDocumentPartOptions

        protected DocumentPartOptions getPreviousDocumentPartOptions()

        Gets the previous formatted options.

        Returns:
        The previous formatted options.
      • isFirstItem

        protected boolean isFirstItem()

        Gets a value indicating whether formatter has the previous formatted item.

        Returns:
        A boolean if formatter has the previous formatted item; otherwise, false.
      • reset

        public void reset()

        Resets the previous formatted item.

      • getText

        public String getText(T item,
                     DocumentPartOptions documentPartOptions)

        Converts item to the string with formatting.

        Parameters:
        item - The item for formatting.
        documentPartOptions - The options for formatting.
        Returns:
        A string that represents formatted item.
      • getText

        public String getText(T item)

        Converts item to the string with formatting.

        Parameters:
        item - The item for formatting.
        Returns:
        A string that represents formatted item.
      • formatText

        protected abstract String formatText(T item,
                        DocumentPartOptions documentPartOptions)

        Converts item to the string with formatting.

        Parameters:
        item - The item for formatting.
        documentPartOptions - The options for formatting.
        Returns:
        A string that represents formatted item.