Interface DocxHook
- All Superinterfaces:
Hook
- All Known Implementing Classes:
CommentHook, TagHook
Interface for hooks that process specific parts of a DOCX document.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DocxHookConverts an object to a hook.static booleanChecks if the given object is a potential hook.static booleanChecks if the given tag is of the specified type.static DocxHooknewCommentHook(DocxPart part, org.docx4j.wml.CTSmartTagRun tag) Creates a new comment hook.static ResetableIterator<DocxHook> Creates an iterator over the hooks in the given content accessor.booleanrun(EngineFactory engineFactory, ContextRoot contextTree, OfficeStamperEvaluationContextFactory officeStamperContextFactory) Executes the hook's logic within the context of a document processing flow.Methods inherited from interface Hook
setContextKey
-
Method Details
-
ofHooks
static ResetableIterator<DocxHook> ofHooks(org.docx4j.wml.ContentAccessor contentAccessor, DocxPart part) Creates an iterator over the hooks in the given content accessor.- Parameters:
contentAccessor- the content accessor to search for hooks.part- the document part.- Returns:
- an iterator over the found hooks.
-
isPotentialHook
Checks if the given object is a potential hook.- Parameters:
o- the object to check.- Returns:
trueif it is a potential hook.
-
asHook
-
isType
-
newCommentHook
-
run
boolean run(EngineFactory engineFactory, ContextRoot contextTree, OfficeStamperEvaluationContextFactory officeStamperContextFactory) Executes the hook's logic within the context of a document processing flow.- Parameters:
engineFactory- a factory responsible for creating instances of theEngineclass, which may be used during the execution of the hook's logiccontextTree- the root of the context tree, representing the hierarchical structure of context branches available during document processingofficeStamperContextFactory- a factory for creating evaluation contexts, which are used to evaluate expressions and handle dynamic behavior during the document processing flow- Returns:
trueif the execution of the hook was successful, otherwisefalse
-