コード例 #1
0
 public PdfObjectTreeNode getAncestor() {
   if (isRecursive()) {
     PdfObjectTreeNode node = this;
     while (true) {
       node = (PdfObjectTreeNode) node.getParent();
       if (node.isIndirectReference() && node.getNumber() == getNumber()) {
         return node;
       }
     }
   }
   return null;
 }
コード例 #2
0
 @SuppressWarnings("unchecked")
 public PdfObjectTreeNode getChildNode(PdfObjectTreeNode node, PdfName key) {
   Enumeration<PdfObjectTreeNode> children = node.breadthFirstEnumeration();
   PdfObjectTreeNode child;
   while (children.hasMoreElements()) {
     child = children.nextElement();
     if (child.isDictionaryNode(key)) {
       if (child.isIndirectReference()) {
         expandNode(child);
         child = (PdfObjectTreeNode) child.getFirstChild();
       }
       expandNode(child);
       return child;
     }
   }
   return null;
 }