/** * Gets the recursive prefix string represent of the filter from this node * down. * * @see java.lang.Object#toString() * @return A string representing the AndNode */ public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "(!" ); buf.append( super.toString() ); buf.append( getFirstChild() ); buf.append( ')' ); return buf.toString(); } }
/** * Gets the recursive prefix string represent of the filter from this node * down. * * @see java.lang.Object#toString() * @return A string representing the AndNode */ public String toString() { StringBuffer buf = new StringBuffer(); buf.append( "(&" ); buf.append( super.toString() ); for ( ExprNode child:getChildren() ) { buf.append( child ); } buf.append( ')' ); return buf.toString(); }
/** * Gets the recursive prefix string represent of the filter from this node * down. * * @see java.lang.Object#toString() * @return A string representing the AndNode */ public String toString() { StringBuilder buf = new StringBuilder(); buf.append( "(|" ); buf.append( super.toString() ); for ( ExprNode child:getChildren() ) { buf.append( child ); } buf.append( ')' ); return buf.toString(); }
/** * 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()); } }