public boolean assertCandidate( IndexRecord rec ) throws NamingException { // NOTICE THE ! HERE // The candidate is valid if it does not pass assertion. A // candidate that passes assertion is therefore invalid. return !evaluator.evaluate( node.getChild(), rec ); } };
/** * Handle conjunction, disjunction and negation nodes and recursively call the generic matcher on children. * * @return the boolean value of the evaluation of the sub expression */ private boolean branchMatch(Attributes attributes, BranchNode branchElement) { if (branchElement.isConjunction()) { for (ExprNode child : branchElement.getChildren()) { if (!recursiveMatch(attributes, child)) { return false; } } return true; } else if (branchElement.isDisjunction()) { for (ExprNode child : branchElement.getChildren()) { if (recursiveMatch(attributes, child)) { return true; } } return false; } else if (branchElement.isNegation()) { return !recursiveMatch(attributes, branchElement.getChild()); } else { throw new DirectoryException("unsupported branching filter element type: " + branchElement.toString()); } }
filter = child.getChild();