Example #1
0
 /* Returns whether the node is visible by the TreeWalker. */
 private boolean isNodeVisible(final Node n) {
   if (acceptNode(n) == NodeFilter.FILTER_ACCEPT) {
     if (filter_ == null || filter_.acceptNode(n) == NodeFilter.FILTER_ACCEPT) {
       if (!expandEntityReferences_) {
         if (n.getParent() != null && n.getParent().getNodeType() == Node.ENTITY_REFERENCE_NODE) {
           return false;
         }
       }
       return true;
     }
   }
   return false;
 }
Example #2
0
 /* Returns whether the node is rejected by the TreeWalker. */
 private boolean isNodeRejected(final Node n) {
   if (acceptNode(n) == NodeFilter.FILTER_REJECT) {
     return true;
   }
   if (filter_ != null && filter_.acceptNode(n) == NodeFilter.FILTER_REJECT) {
     return true;
   }
   if (!expandEntityReferences_) {
     if (n.getParent() != null && n.getParent().getNodeType() == Node.ENTITY_REFERENCE_NODE) {
       return true;
     }
   }
   return false;
 }
Example #3
0
 protected void write(IXmlSerializer writer, NodeFilter filter) throws IOException {
   if (filter == null || filter.acceptNode(this) == NodeFilter.ACCEPT) {
     writer.cdsect(data);
   }
 }