Package pro.verron.officestamper.test
Class CustomCommentProcessor
java.lang.Object
pro.verron.officestamper.api.AbstractCommentProcessor
pro.verron.officestamper.test.CustomCommentProcessor
- All Implemented Interfaces:
CommentProcessor
,ICustomCommentProcessor
public class CustomCommentProcessor
extends AbstractCommentProcessor
implements ICustomCommentProcessor
This is an example of a custom
CommentProcessor
implementation.
Users of the docx-stamper library could use it to understand how they could leverage the library to create their own custom comment processors.
Specifically, it's designed to replace each paragraph that has been
commented with the annotation "visitParagraph" exposed by the
ICustomCommentProcessor.visitParagraph()
public method,
marking it with the text 'Visited' in the resultant stamped Word
document.
- Since:
- 1.6.6
- Version:
- ${version}
- Author:
- Joseph Verron
-
Field Summary
Fields inherited from class pro.verron.officestamper.api.AbstractCommentProcessor
placeholderReplacer
-
Constructor Summary
ConstructorDescriptionCustomCommentProcessor
(ParagraphPlaceholderReplacer placeholderReplacer) Constructor for CustomCommentProcessor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
commitChanges
(DocxPart document) void
reset()
void
setCurrentCommentWrapper
(Comment comment) void
setCurrentRun
(org.docx4j.wml.R run) void
setParagraph
(Paragraph paragraph) void
visitParagraph.Methods inherited from class pro.verron.officestamper.api.AbstractCommentProcessor
getCurrentCommentWrapper, getCurrentRun, getParagraph, setParagraph, setProcessorContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface pro.verron.officestamper.api.CommentProcessor
commitChanges, getParagraph, setParagraph, setProcessorContext
-
Constructor Details
-
CustomCommentProcessor
Constructor for CustomCommentProcessor.
- Parameters:
placeholderReplacer
- aParagraphPlaceholderReplacer
object
-
-
Method Details
-
commitChanges
- Specified by:
commitChanges
in interfaceCommentProcessor
-
reset
public void reset()- Specified by:
reset
in interfaceCommentProcessor
-
setCurrentCommentWrapper
- Specified by:
setCurrentCommentWrapper
in interfaceCommentProcessor
- Overrides:
setCurrentCommentWrapper
in classAbstractCommentProcessor
-
setParagraph
- Overrides:
setParagraph
in classAbstractCommentProcessor
-
setCurrentRun
public void setCurrentRun(org.docx4j.wml.R run) - Specified by:
setCurrentRun
in interfaceCommentProcessor
- Overrides:
setCurrentRun
in classAbstractCommentProcessor
-
visitParagraph
public void visitParagraph()visitParagraph.
- Specified by:
visitParagraph
in interfaceICustomCommentProcessor
-