All Superinterfaces:
CommentProcessor

@Deprecated(since="1.6.8", forRemoval=true) public interface ICommentProcessor extends CommentProcessor
Deprecated, for removal: This API element is subject to removal in a future version.
since 1.6.8, This class has been deprecated in the effort of the library modularization. It is recommended to use the CommentProcessor class instead. This class will not be exported in the future releases of the module.

In a .docx template used by DocxStamper, you can comment paragraphs of text to manipulate them. The comments in the .docx template are passed to an implementation of ICommentProcessor that understands the expression used within the comment. Thus, you can implement your own ICommentProcessor to extend the expression language available in comments in the .docx template.

To implement a comment processor, you have to do the following steps:

  1. Create an interface that defines the custom method(s) you want to expose to the expression language used in .docx comments
  2. Create an implementation of your interface
  3. Register your comment processor with DocxStamper

1. Creating a comment processor interface
For example, if you want to create a comment processor that makes a paragraph of text bold based on some condition, you would create an interface with the method boldIf(boolean condition).

2. Creating an implementation of your interface
Your implementation class must also implement the Interface ICommentProcessor. To stay in the above example, when the boldIf method is called, simply keep track of the paragraphs that are to be made bold. The currently processed paragraph is passed into the method setCurrentParagraph() before your own method (in this case boldIf()) is called. Within the method commitChanges() you then do the manipulations on the word document, i.e. make the paragraphs that were commented bold.

3. Registering you comment processor with DocxStamper
Register your comment processor in DocxStamper by calling DocxStamperConfiguration#addCommentProcessor().

Since:
1.0.0
Version:
${version}
Author:
Joseph Verron, Tom Hombergs