java.lang.Object
pro.verron.officestamper.api.AbstractCommentProcessor
- All Implemented Interfaces:
CommentProcessor
AbstractCommentProcessor is an abstract base class for comment processors.
It implements the CommentProcessor interface.
It provides common functionality and fields that subclasses can use.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ParagraphPlaceholderReplacer
PlaceholderReplacer used to replace expressions in the comment text. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractCommentProcessor
(ParagraphPlaceholderReplacer placeholderReplacer) Creates an instance of AbstractCommentProcessor with the given ParagraphPlaceholderReplacer. -
Method Summary
Modifier and TypeMethodDescriptionorg.docx4j.wml.R
Retrieves the current paragraph being processed.void
setCurrentCommentWrapper
(Comment currentComment) Sets the current comment being processed in the comment processor.void
setCurrentRun
(org.docx4j.wml.R run) Sets the currently processed run in the comment processor.void
setParagraph
(org.docx4j.wml.P paragraph) Deprecated, for removal: This API element is subject to removal in a future version.void
setParagraph
(Paragraph paragraph) void
setProcessorContext
(ProcessorContext processorContext) Sets the processing context for the comment processor.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, commitChanges, reset
-
Field Details
-
placeholderReplacer
PlaceholderReplacer used to replace expressions in the comment text.
-
-
Constructor Details
-
AbstractCommentProcessor
Creates an instance of AbstractCommentProcessor with the given ParagraphPlaceholderReplacer.- Parameters:
placeholderReplacer
- the ParagraphPlaceholderReplacer used to replace expressions in the comment text
-
-
Method Details
-
getCurrentCommentWrapper
-
setCurrentCommentWrapper
Description copied from interface:CommentProcessor
Sets the current comment being processed in the comment processor. This method is typically invoked to specify the comment object associated with the current processing context.- Specified by:
setCurrentCommentWrapper
in interfaceCommentProcessor
- Parameters:
currentComment
- the comment object that is currently being processed
-
setProcessorContext
Description copied from interface:CommentProcessor
Sets the processing context for the comment processor. This method serves to pass relevant contextual information, such as the current paragraph, run, comment, and placeholder being processed. It's always invoked before any custom methods of the customCommentProcessor
interface.- Specified by:
setProcessorContext
in interfaceCommentProcessor
- Parameters:
processorContext
- the context in which the processor operates, containing details about the paragraph, run, comment, and placeholder being processed.
-
getCurrentRun
public org.docx4j.wml.R getCurrentRun() -
setCurrentRun
public void setCurrentRun(@Nullable org.docx4j.wml.R run) Description copied from interface:CommentProcessor
Sets the currently processed run in the comment processor. This method should be called to specify the current run within the context of processing a document.- Specified by:
setCurrentRun
in interfaceCommentProcessor
- Parameters:
run
- the run object that is currently being processed, or null if there is no specific run to set
-
getParagraph
Description copied from interface:CommentProcessor
Retrieves the current paragraph being processed.- Specified by:
getParagraph
in interfaceCommentProcessor
- Returns:
- the current
Paragraph
object associated with the comment processor
-
setParagraph
Deprecated, for removal: This API element is subject to removal in a future version.usesetParagraph(Paragraph)
insteadDescription copied from interface:CommentProcessor
Sets the current paragraph being processed in the comment processor. This method is deprecated and scheduled for removal in a future version.- Specified by:
setParagraph
in interfaceCommentProcessor
- Parameters:
paragraph
- coordinates of the currently processed paragraph within the template.
-
setParagraph
-
setParagraph(Paragraph)
instead