Class BaseCommentProcessor

java.lang.Object
org.wickedsource.docxstamper.processor.BaseCommentProcessor
All Implemented Interfaces:
ICommentProcessor
Direct Known Subclasses:
DisplayIfProcessor, ParagraphRepeatProcessor, RepeatDocPartProcessor, RepeatProcessor, ReplaceWithProcessor, TableResolver

public abstract class BaseCommentProcessor extends Object implements ICommentProcessor
Base class for comment processors. The current run and paragraph are set by the DocxStamper class.
Version:
${version}
Author:
Joseph Verron
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final PlaceholderReplacer
    PlaceholderReplacer used to replace placeholders in the comment text.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor for BaseCommentProcessor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Getter for the field currentCommentWrapper.
    org.docx4j.wml.R
    Getter for the field currentRun.
    org.docx4j.openpackaging.packages.WordprocessingMLPackage
    Deprecated, for removal: This API element is subject to removal in a future version.
    the document is passed to the processor through the commitChange method now and will probably pe passed through the constructor in the future
    org.docx4j.wml.P
    Getter for the field paragraph.
    void
    Passes the comment range wrapper that is currently being processed (i.e.
    void
    setCurrentRun(org.docx4j.wml.R run)
    Passes the run that is currently being processed (i.e.
    void
    setDocument(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
    Deprecated, for removal: This API element is subject to removal in a future version.
    the document is passed to the processor through the commitChange method now, and will probably pe passed through the constructor in the future
    void
    setParagraph(org.docx4j.wml.P paragraph)
    Passes the paragraph that is currently being processed (i.e.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.wickedsource.docxstamper.api.commentprocessor.ICommentProcessor

    commitChanges, reset
  • Field Details

    • placeholderReplacer

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

    • BaseCommentProcessor

      protected BaseCommentProcessor(PlaceholderReplacer placeholderReplacer)

      Constructor for BaseCommentProcessor.

      Parameters:
      placeholderReplacer - PlaceholderReplacer used to replace placeholders in the comment text.
  • Method Details

    • setCurrentRun

      public 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). This method is always called BEFORE the custom methods of the custom comment processor interface are called.
      Specified by:
      setCurrentRun in interface ICommentProcessor
      Parameters:
      run - coordinates of the currently processed run within the template.
    • setParagraph

      public void setParagraph(org.docx4j.wml.P paragraph)
      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.
      Specified by:
      setParagraph in interface ICommentProcessor
      Parameters:
      paragraph - coordinates of the currently processed paragraph within the template.
    • setCurrentCommentWrapper

      public void setCurrentCommentWrapper(CommentWrapper currentCommentWrapper)
      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.
      Specified by:
      setCurrentCommentWrapper in interface ICommentProcessor
      Parameters:
      currentCommentWrapper - of the currently processed comment within the template.
    • setDocument

      @Deprecated(since="1.6.5", forRemoval=true) public void setDocument(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
      Deprecated, for removal: This API element is subject to removal in a future version.
      the document is passed to the processor through the commitChange method now, and will probably pe passed through the constructor in the future
      Passes the processed document, in order to make all linked data (images, etc.) available to processors that need it (example : repeatDocPart)
      Specified by:
      setDocument in interface ICommentProcessor
      Parameters:
      document - DocX template being processed.
    • getCurrentCommentWrapper

      public CommentWrapper getCurrentCommentWrapper()

      Getter for the field currentCommentWrapper.

      Returns:
      a CommentWrapper object
    • getParagraph

      public org.docx4j.wml.P getParagraph()

      Getter for the field paragraph.

      Returns:
      a P object
    • getCurrentRun

      public org.docx4j.wml.R getCurrentRun()

      Getter for the field currentRun.

      Returns:
      a R object
    • getDocument

      @Deprecated(since="1.6.5", forRemoval=true) public org.docx4j.openpackaging.packages.WordprocessingMLPackage getDocument()
      Deprecated, for removal: This API element is subject to removal in a future version.
      the document is passed to the processor through the commitChange method now and will probably pe passed through the constructor in the future

      Getter for the field document.

      Returns:
      a WordprocessingMLPackage object