Class AbstractCommentProcessor
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 ParagraphPlaceholderReplacerPlaceholderReplacer used to replace expressions in the comment text. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCommentProcessor(ParagraphPlaceholderReplacer placeholderReplacer) Creates an instance of AbstractCommentProcessor with the given ParagraphPlaceholderReplacer. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the current comment wrapper associated with the processor.org.docx4j.wml.RRetrieves the current run being processed.Retrieves the current paragraph being processed.voidsetCurrentCommentWrapper(Comment currentComment) Sets the current comment being processed in the comment processor.voidsetCurrentRun(org.docx4j.wml.R run) Sets the currently processed run in the comment processor.voidsetParagraph(org.docx4j.wml.P paragraph) Deprecated, for removal: This API element is subject to removal in a future version.voidsetParagraph(Paragraph paragraph) Sets the current paragraph being processed.voidsetProcessorContext(ProcessorContext processorContext) Sets the processing context for the comment processor.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:CommentProcessorSets 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:
setCurrentCommentWrapperin interfaceCommentProcessor- Parameters:
currentComment- the comment object that is currently being processed
-
setProcessorContext
Description copied from interface:CommentProcessorSets 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 customCommentProcessorinterface.- Specified by:
setProcessorContextin 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()Retrieves the current run being processed.- Returns:
- the current
Robject being processed
-
setCurrentRun
public void setCurrentRun(@Nullable org.docx4j.wml.R run) Description copied from interface:CommentProcessorSets 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:
setCurrentRunin 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:CommentProcessorRetrieves the current paragraph being processed.- Specified by:
getParagraphin interfaceCommentProcessor- Returns:
- the current
Paragraphobject 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:CommentProcessorSets the current paragraph being processed in the comment processor.- Specified by:
setParagraphin interfaceCommentProcessor- Parameters:
paragraph- coordinates of the currently processed paragraph within the template.
-
setParagraph
Sets the current paragraph being processed.- Parameters:
paragraph- the Paragraph instance representing the currently processed paragraph in the document.
-
setParagraph(Paragraph)instead