Class AbstractCommentProcessor

java.lang.Object
pro.verron.officestamper.api.AbstractCommentProcessor
All Implemented Interfaces:
CommentProcessor

public abstract class AbstractCommentProcessor extends Object implements CommentProcessor
AbstractCommentProcessor is an abstract base class for comment processors. It implements the CommentProcessor interface. It provides common functionality and fields that subclasses can use.
  • Field Details

    • placeholderReplacer

      protected final ParagraphPlaceholderReplacer placeholderReplacer
      PlaceholderReplacer used to replace expressions in the comment text.
  • Constructor Details

    • AbstractCommentProcessor

      protected AbstractCommentProcessor(ParagraphPlaceholderReplacer placeholderReplacer)
      Creates an instance of AbstractCommentProcessor with the given ParagraphPlaceholderReplacer.
      Parameters:
      placeholderReplacer - the ParagraphPlaceholderReplacer used to replace expressions in the comment text
  • Method Details

    • getCurrentCommentWrapper

      public Comment getCurrentCommentWrapper()
    • setCurrentCommentWrapper

      public void setCurrentCommentWrapper(Comment currentComment)
      Description copied from interface: CommentProcessor
      Sets the current comment being processed in the comment processor. This method is typically invoked to specify the comment object associated with the current processing context.
      Specified by:
      setCurrentCommentWrapper in interface CommentProcessor
      Parameters:
      currentComment - the comment object that is currently being processed
    • setProcessorContext

      public void setProcessorContext(ProcessorContext processorContext)
      Description copied from interface: CommentProcessor
      Sets the processing context for the comment processor. This method serves to pass relevant contextual information, such as the current paragraph, run, comment, and placeholder being processed. It's always invoked before any custom methods of the custom CommentProcessor interface.
      Specified by:
      setProcessorContext in interface CommentProcessor
      Parameters:
      processorContext - the context in which the processor operates, containing details about the paragraph, run, comment, and placeholder being processed.
    • getCurrentRun

      public org.docx4j.wml.R getCurrentRun()
    • setCurrentRun

      public void setCurrentRun(@Nullable org.docx4j.wml.R run)
      Description copied from interface: CommentProcessor
      Sets the currently processed run in the comment processor. This method should be called to specify the current run within the context of processing a document.
      Specified by:
      setCurrentRun in interface CommentProcessor
      Parameters:
      run - the run object that is currently being processed, or null if there is no specific run to set
    • getParagraph

      public Paragraph getParagraph()
      Description copied from interface: CommentProcessor
      Retrieves the current paragraph being processed.
      Specified by:
      getParagraph in interface CommentProcessor
      Returns:
      the current Paragraph object associated with the comment processor
    • setParagraph

      @Deprecated(since="2.6", forRemoval=true) public void setParagraph(org.docx4j.wml.P paragraph)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Description copied from interface: CommentProcessor
      Sets the current paragraph being processed in the comment processor. This method is deprecated and scheduled for removal in a future version.
      Specified by:
      setParagraph in interface CommentProcessor
      Parameters:
      paragraph - coordinates of the currently processed paragraph within the template.
    • setParagraph

      public void setParagraph(Paragraph paragraph)