Class DisplayIfProcessor
java.lang.Object
org.wickedsource.docxstamper.processor.BaseCommentProcessor
org.wickedsource.docxstamper.processor.displayif.DisplayIfProcessor
- All Implemented Interfaces:
ICommentProcessor,IDisplayIfProcessor
Processor for the
IDisplayIfProcessor comment.- Version:
- 1.6.6
- Author:
- Joseph Verron
-
Field Summary
Fields inherited from class org.wickedsource.docxstamper.processor.BaseCommentProcessor
placeholderReplacer -
Method Summary
Modifier and TypeMethodDescriptionvoidcommitChanges(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) This method is called after all comments in the .docx template have been passed to the comment processor.voiddisplayParagraphIf(Boolean condition) May be called to delete the commented paragraph or not, depending on the given boolean condition.voiddisplayParagraphIfPresent(Object condition) May be called to delete the commented paragraph or not, depending on the presence of the given data.voiddisplayTableIf(Boolean condition) May be called to delete the table surrounding the commented paragraph, depending on the given boolean condition.voiddisplayTableRowIf(Boolean condition) May be called to delete the table surrounding the commented paragraph, depending on the given boolean condition.static ICommentProcessorCreates a new DisplayIfProcessor instance.voidreset()Resets all state in the comment processor so that it can be re-used in another stamping process.Methods inherited from class org.wickedsource.docxstamper.processor.BaseCommentProcessor
getCurrentCommentWrapper, getCurrentRun, getDocument, getParagraph, setCurrentCommentWrapper, setCurrentRun, setDocument, setParagraph
-
Method Details
-
newInstance
Creates a new DisplayIfProcessor instance.- Parameters:
pr- thePlaceholderReplacerto 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:
commitChangesin interfaceICommentProcessor- 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:
resetin interfaceICommentProcessor
-
displayParagraphIf
May be called to delete the commented paragraph or not, depending on the given boolean condition.- Specified by:
displayParagraphIfin interfaceIDisplayIfProcessor- Parameters:
condition- if true, the commented paragraph will remain in the document. If false, the commented paragraph will be deleted at stamping.
-
displayParagraphIfPresent
May be called to delete the commented paragraph or not, depending on the presence of the given data.- Specified by:
displayParagraphIfPresentin interfaceIDisplayIfProcessor- Parameters:
condition- if non null, the commented paragraph will remain in the document. If null, the commented paragraph will be deleted at stamping.
-
displayTableIf
May be called to delete the table surrounding the commented paragraph, depending on the given boolean condition.- Specified by:
displayTableIfin interfaceIDisplayIfProcessor- 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
May be called to delete the table surrounding the commented paragraph, depending on the given boolean condition.- Specified by:
displayTableRowIfin interfaceIDisplayIfProcessor- 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.
-