- All Known Subinterfaces:
ICommentProcessor
- All Known Implementing Classes:
AbstractCommentProcessor,BaseCommentProcessor,TableResolver
public interface CommentProcessor
CommentProcessor is an interface that defines the methods for processing comments in a .docx template.
-
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.voidreset()Resets all states in the comment processor so that it can be re-used in another stamping process.voidsetCurrentCommentWrapper(Comment comment) Passes the comment range wrapper that is currently being processed (i.e., the start and end of comment that in the .docx template).voidsetCurrentRun(org.docx4j.wml.R run) Passes the run that is currently being processed (i.e., the run that is commented in the .docx template).voidsetDocument(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) Deprecated, for removal: This API element is subject to removal in a future version.the document is passed to the processor through the commitChange method now, and will probably pe passed through the constructor in the futurevoidsetParagraph(org.docx4j.wml.P paragraph) Passes the paragraph that is currently being processed (i.e., the paragraph that is commented in the .docx template).
-
Method Details
-
commitChanges
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 the custom methods of a comment processor, the ongoing iteration over the paragraphs in the document may be disturbed.- Parameters:
document- The Word document that can be manipulated by using the DOCX4J api.
-
setParagraph
void setParagraph(org.docx4j.wml.P paragraph) Passes the paragraph that is currently being processed (i.e., the paragraph that is commented in the .docx template). This method is always called BEFORE the custom methods of the custom comment processor interface are called.- Parameters:
paragraph- coordinates of the currently processed paragraph within the template.
-
setCurrentRun
void setCurrentRun(org.docx4j.wml.R run) Passes the run that is currently being processed (i.e., the run that is commented in the .docx template). This method is always called BEFORE the custom methods of the custom comment processor interface are called.- Parameters:
run- coordinates of the currently processed run within the template.
-
setCurrentCommentWrapper
Passes the comment range wrapper that is currently being processed (i.e., the start and end of comment that in the .docx template). This method is always called BEFORE the custom methods of the custom comment processor interface are called.- Parameters:
comment- of the currently processed comment within the template.
-
setDocument
@Deprecated(since="1.6.5", forRemoval=true) void setDocument(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) Deprecated, for removal: This API element is subject to removal in a future version.the document is passed to the processor through the commitChange method now, and will probably pe passed through the constructor in the futurePasses the processed document, to make all linked data (images, etc.) available to processors that need it (example: repeatDocPart)- Parameters:
document- DocX template being processed.
-
reset
void reset()Resets all states in the comment processor so that it can be re-used in another stamping process.
-