Class PlaceholderHooker.ParagraphCollector
java.lang.Object
org.docx4j.utils.TraversalUtilVisitor<org.docx4j.wml.P>
pro.verron.officestamper.api.PlaceholderHooker.ParagraphCollector
- Enclosing class:
PlaceholderHooker
public static class PlaceholderHooker.ParagraphCollector
extends org.docx4j.utils.TraversalUtilVisitor<org.docx4j.wml.P>
A TraversalUtilVisitor implementation that collects the paragraphs possibly holding a placeholder.
This class is used to traverse a document and collect all paragraph elements (P) containing at least one of
the given opening delimiters. The collected paragraphs can be retrieved using the paragraphs() method.
-
Constructor Summary
ConstructorsConstructorDescriptionParagraphCollector(Collection<String> openings) Constructs a newPlaceholderHooker.ParagraphCollectorwith the specified opening delimiters. -
Method Summary
Methods inherited from class org.docx4j.utils.TraversalUtilVisitor
apply
-
Constructor Details
-
ParagraphCollector
Constructs a newPlaceholderHooker.ParagraphCollectorwith the specified opening delimiters.- Parameters:
openings- the opening delimiters to look for in paragraphs
-
-
Method Details
-
apply
public void apply(org.docx4j.wml.P element) - Overrides:
applyin classorg.docx4j.utils.TraversalUtilVisitor<org.docx4j.wml.P>
-
paragraphs
Returns the list of collected paragraphs possibly holding a placeholder.- Returns:
- a list of paragraphs containing at least one opening delimiter
-