Module pro.verron.officestamper
Class CommentProcessorRegistry
java.lang.Object
org.wickedsource.docxstamper.processor.CommentProcessorRegistry
Allows registration of
ICommentProcessor objects. Each registered
ICommentProcessor must implement an interface which has to be specified at
registration time. Provides several getter methods to access the registered
ICommentProcessor.- Since:
- 1.0.0
- Version:
- ${version}
- Author:
- Joseph Verron, Tom Hombergs
-
Constructor Summary
ConstructorsConstructorDescriptionCommentProcessorRegistry(ExpressionResolver expressionResolver, Map<Class<?>, Object> commentProcessors, boolean failOnUnresolvedExpression) Creates a new CommentProcessorRegistry. -
Method Summary
Modifier and TypeMethodDescriptionvoidreset()Resets all registered ICommentProcessors.<T> voidrunProcessors(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, T expressionContext) Lets each registered ICommentProcessor run on the specified docx document.
-
Constructor Details
-
CommentProcessorRegistry
public CommentProcessorRegistry(ExpressionResolver expressionResolver, Map<Class<?>, Object> commentProcessors, boolean failOnUnresolvedExpression) Creates a new CommentProcessorRegistry.- Parameters:
expressionResolver- the expression resolvercommentProcessors- the comment processorsfailOnUnresolvedExpression- whether to fail on unresolved expressions
-
-
Method Details
-
runProcessors
public <T> void runProcessors(org.docx4j.openpackaging.packages.WordprocessingMLPackage document, T expressionContext) Lets each registered ICommentProcessor run on the specified docx document. At the end of the document, the commit method is called for each ICommentProcessor. The ICommentProcessors are run in the order they were registered.- Type Parameters:
T- a T class- Parameters:
document- the docx document over which to run the registered ICommentProcessors.expressionContext- the context root object
-
reset
public void reset()Resets all registered ICommentProcessors.
-