org.apache.directory.shared.ldap.filter
Interface FilterVisitor

All Known Implementing Classes:
BranchNormalizedVisitor

public interface FilterVisitor

Filter expression tree node visitor interface. Note that this is a variation of the extrinsic visitor variation. It has the following advantages over the standard visitor pattern:

Version:
$Revision: 664290 $
Author:
Apache Directory Project

Method Summary
 boolean canVisit(ExprNode node)
          Checks to see if a node can be visited.
 java.util.List<ExprNode> getOrder(BranchNode node, java.util.List<ExprNode> children)
          Get the array of children to visit sequentially to determine the order of child visitations.
 boolean isPrefix()
          Determines whether the visitation order is prefix or postfix.
 java.lang.Object visit(ExprNode node)
          Visits a filter expression AST using a specific visitation order.
 

Method Detail

visit

java.lang.Object visit(ExprNode node)
Visits a filter expression AST using a specific visitation order.

Parameters:
node - the node to visit
Returns:
node the resulting modified node

canVisit

boolean canVisit(ExprNode node)
Checks to see if a node can be visited.

Parameters:
node - the node to be visited
Returns:
whether or node the node should be visited

isPrefix

boolean isPrefix()
Determines whether the visitation order is prefix or postfix.

Returns:
true if the visitation is in prefix order, false otherwise.

getOrder

java.util.List<ExprNode> getOrder(BranchNode node,
                                  java.util.List<ExprNode> children)
Get the array of children to visit sequentially to determine the order of child visitations. Some children may not be returned at all if canVisit() returns false on them.

Parameters:
node - the parent branch node
children - the child node array
Returns:
the new reordered array of children


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.