@Override
  public void visit(ParaNode node) {
    boolean printParagraphTag = true;

    List<Node> childNodes = node.getChildren();

    for (Node childNode : childNodes) {
      List<Node> grandchildNodes = childNode.getChildren();

      for (Node grandchildNode : grandchildNodes) {
        if (grandchildNode instanceof TextNode) {
          TextNode textNode = (TextNode) grandchildNode;

          String text = textNode.getText();

          if (text.equals("+$$$") || text.equals("$$$")) {
            visitChildren(node);

            printParagraphTag = false;
          }
        }
      }
    }

    if (printParagraphTag) {
      printTag(node, "p");
    }
  }
Esempio n. 2
0
  public void process(int depth, Node node) {
    if (depth == 0) {
      references.traverse(node);
    }

    Processor processor = processors().get(node.getClass());
    if (processor == null) {
      log.warn("No processor defined for type {}", node.getClass());
      processor = processorDefault;
    }

    treeNavigation.push(node);

    dumpProcessor(depth, node, processor);
    processor.process(depth, node, this);

    treeNavigation.pop();
  }
Esempio n. 3
0
 public List<Element> collectChildren(int level, Node node) {
   Collector<Element> collector = new Collector<Element>();
   iTextContext().pushElementConsumer(collector);
   for (Node child : node.getChildren()) {
     process(level + 1, child);
   }
   iTextContext().popElementConsumer();
   return collector.getCollected();
 }
  public PicWithCaptionNode(String src, Node node) {
    super(node);

    _src = src;

    List<Node> nodes = node.getChildren();

    if ((nodes != null) && !nodes.isEmpty() && (nodes.get(0) instanceof TextNode)) {

      TextNode textNode = (TextNode) nodes.get(0);

      _alt = textNode.getText();
    } else {
      _alt = _BLANK;
    }
  }
 void visitChildren(@NotNull SuperNode node) {
   for (Node child : node.getChildren()) {
     child.accept(this);
   }
 }
Esempio n. 6
0
 public void processChildren(int level, Node node) {
   for (Node child : node.getChildren()) {
     process(level + 1, child);
   }
 }