예제 #1
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();
 }
예제 #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();
  }
예제 #3
0
 public void processChildren(int level, Node node) {
   for (Node child : node.getChildren()) {
     process(level + 1, child);
   }
 }