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: 379008 $
Author:
Alex Karasulu, $Author: akarasulu $

Method Summary
 boolean canVisit(ExprNode a_node)
          Checks to see if a node can be visited.
 java.util.ArrayList getOrder(BranchNode node, java.util.ArrayList a_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.
 void visit(ExprNode a_node)
          Visits a filter expression AST using a specific visitation order.
 

Method Detail

visit

public void visit(ExprNode a_node)
Visits a filter expression AST using a specific visitation order.

Parameters:
a_node - the node to visit

canVisit

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

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

isPrefix

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

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

getOrder

public java.util.ArrayList getOrder(BranchNode node,
                                    java.util.ArrayList a_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
a_children - the child node array
Returns:
the new reordered array of children


Copyright © 2003-2006 . All Rights Reserved.