Interface CommentProcessor

All Known Implementing Classes:
AbstractCommentProcessor

public interface CommentProcessor
CommentProcessor is an interface that defines the methods for processing comments in a .docx template.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    commitChanges(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
    Deprecated, for removal: This API element is subject to removal in a future version.
    default void
    This method is called after all comments in the .docx template have been passed to the comment processor.
     
    void
    Resets all states in the comment processor so that it can be re-used in another stamping process.
    void
    Passes the comment range wrapper that is currently being processed (i.e., the start and end of comment that in the .docx template).
    void
    setCurrentRun(org.docx4j.wml.R run)
    Passes the run that is currently being processed (i.e., the run that is commented in the .docx template).
    void
    setParagraph(org.docx4j.wml.P paragraph)
    Deprecated, for removal: This API element is subject to removal in a future version.
    void
     
  • Method Details

    • setProcessorContext

      void setProcessorContext(ProcessorContext processorContext)
    • setCurrentRun

      void setCurrentRun(@Nullable org.docx4j.wml.R run)
      Passes the run that is currently being processed (i.e., the run that is commented in the .docx template). This method is always called BEFORE the custom methods of the custom comment processor interface are called.
      Parameters:
      run - coordinates of the currently processed run within the template.
    • commitChanges

      default void commitChanges(DocxPart docxPart)
      This method is called after all comments in the .docx template have been passed to the comment processor. All manipulations of the .docx document SHOULD BE done in this method. If certain manipulations are already done within the custom methods of a comment processor, the ongoing iteration over the paragraphs in the document may be disturbed.

      This method replaces the previous commitChanges(WordprocessingMLPackage) and called with a DocxPart as the parameter.

      Parameters:
      docxPart - The DocxPart that can be manipulated by using the DOCX4J api.
    • commitChanges

      @Deprecated(since="2.3", forRemoval=true) default void commitChanges(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
      Deprecated, for removal: This API element is subject to removal in a future version.
      This method is called after all comments in the .docx template have been passed to the comment processor. All manipulations of the .docx document SHOULD BE done in this method. If certain manipulations are already done within the custom methods of a comment processor, the ongoing iteration over the paragraphs in the document may be disturbed.

      This method replaces the previous commitChanges(DocxPart) and called with a DocxPart as the parameter.

      Parameters:
      document - The document that can be manipulated by using the DOCX4J api.
    • getParagraph

      Paragraph getParagraph()
    • setParagraph

      @Deprecated(since="2.6", forRemoval=true) void setParagraph(org.docx4j.wml.P paragraph)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Passes the paragraph that is currently being processed (i.e., the paragraph that is commented in the .docx template). This method is always called BEFORE the custom methods of the custom comment processor interface are called.
      Parameters:
      paragraph - coordinates of the currently processed paragraph within the template.
    • setCurrentCommentWrapper

      void setCurrentCommentWrapper(Comment comment)
      Passes the comment range wrapper that is currently being processed (i.e., the start and end of comment that in the .docx template). This method is always called BEFORE the custom methods of the custom comment processor interface are called.
      Parameters:
      comment - of the currently processed comment within the template.
    • reset

      void reset()
      Resets all states in the comment processor so that it can be re-used in another stamping process.