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 Details

  • Method Details

    • apply

      public void apply(org.docx4j.wml.P element)
      Overrides:
      apply in class org.docx4j.utils.TraversalUtilVisitor<org.docx4j.wml.P>
    • paragraphs

      public List<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