Пример #1
0
 private boolean isAccepted(final Node node) {
   if (filter_ == null) {
     return true;
   }
   Function function = null;
   if (filter_ instanceof Function) {
     function = (Function) filter_;
   }
   final Object acceptNode = filter_.get("acceptNode", filter_);
   if (acceptNode instanceof Function) {
     function = (Function) acceptNode;
   }
   if (function != null) {
     final double value =
         Context.toNumber(
             function.call(
                 Context.getCurrentContext(), getParentScope(), this, new Object[] {node}));
     return value == NodeFilter.FILTER_ACCEPT;
   }
   return true;
 }