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 paragraphs matching a given pattern.
This class is used to traverse a document and collect all paragraph elements (P) that match a specified
regular expression pattern. The collected paragraphs can be retrieved using the paragraphs() method.
-
Constructor Summary
ConstructorsConstructorDescriptionParagraphCollector(Pattern pattern) Constructs a newPlaceholderHooker.ParagraphCollectorwith the specified pattern. -
Method Summary
Methods inherited from class org.docx4j.utils.TraversalUtilVisitor
apply
-
Constructor Details
-
ParagraphCollector
Constructs a newPlaceholderHooker.ParagraphCollectorwith the specified pattern.- Parameters:
pattern- the regular expression pattern to match against 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 that matched the pattern.- Returns:
- an unmodifiable list of paragraphs matching the specified pattern
-