Class CommentRemover
java.lang.Object
pro.verron.officestamper.api.CommentRemover
- All Implemented Interfaces:
PostProcessor
The CommentRemover class is a concrete implementation of the PostProcessor interface. This class is responsible for removing all comments and their corresponding elements from a WordprocessingMLPackage document. It traverses the document, identifies comment elements, removes them from their parent contents, and clears the comments stored in the document's comments part.
Key responsibilities of this class include:
- Identifying all comment-related elements within the document using a CommentFinder instance.
- Removing those elements from their parent's content list.
- Accessing and clearing the document's comments part to ensure no residual comments remain.
This class is designed for scenarios where comments in a document need to be fully removed as part of preprocessing or cleanup operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprocess(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) Processes a given WordprocessingMLPackage document.
-
Constructor Details
-
CommentRemover
public CommentRemover()Build aCommentRemoverinstance
-
-
Method Details
-
process
public void process(org.docx4j.openpackaging.packages.WordprocessingMLPackage document) Description copied from interface:PostProcessorProcesses a given WordprocessingMLPackage document. This method is typically used for performing operations such as modifying content, cleaning up the document structure, or applying other transformations.- Specified by:
processin interfacePostProcessor- Parameters:
document- the WordprocessingMLPackage document to process
-