Class DisplayIfProcessor

java.lang.Object
org.wickedsource.docxstamper.processor.BaseCommentProcessor
org.wickedsource.docxstamper.processor.displayif.DisplayIfProcessor
All Implemented Interfaces:
ICommentProcessor, IDisplayIfProcessor

public class DisplayIfProcessor extends BaseCommentProcessor implements IDisplayIfProcessor
Processor for the IDisplayIfProcessor comment.
Version:
1.6.6
Author:
Joseph Verron
  • Method Details

    • newInstance

      public static ICommentProcessor newInstance(PlaceholderReplacer pr)
      Creates a new DisplayIfProcessor instance.
      Parameters:
      pr - the PlaceholderReplacer to use for replacing placeholders.
      Returns:
      a new DisplayIfProcessor instance.
    • commitChanges

      public void commitChanges(org.docx4j.openpackaging.packages.WordprocessingMLPackage document)
      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 in the custom methods of a comment processor, the ongoing iteration over the paragraphs in the document may be disturbed.
      Specified by:
      commitChanges in interface ICommentProcessor
      Parameters:
      document - The Word document that can be manipulated by using the DOCX4J api.
    • reset

      public void reset()
      Resets all state in the comment processor so that it can be re-used in another stamping process.
      Specified by:
      reset in interface ICommentProcessor
    • displayParagraphIf

      public void displayParagraphIf(Boolean condition)
      May be called to delete the commented paragraph or not, depending on the given boolean condition.
      Specified by:
      displayParagraphIf in interface IDisplayIfProcessor
      Parameters:
      condition - if true, the commented paragraph will remain in the document. If false, the commented paragraph will be deleted at stamping.
    • displayParagraphIfPresent

      public void displayParagraphIfPresent(Object condition)
      May be called to delete the commented paragraph or not, depending on the presence of the given data.
      Specified by:
      displayParagraphIfPresent in interface IDisplayIfProcessor
      Parameters:
      condition - if non null, the commented paragraph will remain in the document. If null, the commented paragraph will be deleted at stamping.
    • displayTableIf

      public void displayTableIf(Boolean condition)
      May be called to delete the table surrounding the commented paragraph, depending on the given boolean condition.
      Specified by:
      displayTableIf in interface IDisplayIfProcessor
      Parameters:
      condition - if true, the table surrounding the commented paragraph will remain in the document. If false, the table will be deleted at stamping.
    • displayTableRowIf

      public void displayTableRowIf(Boolean condition)
      May be called to delete the table surrounding the commented paragraph, depending on the given boolean condition.
      Specified by:
      displayTableRowIf in interface IDisplayIfProcessor
      Parameters:
      condition - if true, the table row surrounding the commented paragraph will remain in the document. If false, the table row will be deleted at stamping.