org.apache.directory.server.core.normalization
Class NormalizingVisitor
java.lang.Object
org.apache.directory.server.core.normalization.NormalizingVisitor
- public class NormalizingVisitor
- extends java.lang.Object
A filter visitor which normalizes leaf node values as it visits them. It also removes
leaf nodes from branches whose attributeType is undefined. It obviously cannot remove
a leaf node from a filter which is only a leaf node. Checks to see if a filter is a
leaf node with undefined attributeTypes should be done outside this visitor.
Since this visitor may remove filter nodes it may produce negative results on filters,
like NOT branch nodes without a child or AND and OR nodes with one or less children. This
might make some partition implementations choke. To avoid this problem we clean up branch
nodes that don't make sense. For example all BranchNodes without children are just
removed. An AND and OR BranchNode with a single child is replaced with it's child for
all but the topmost branchnode which we cannot replace. So again the top most branch
node must be inspected by code outside of this visitor.
- Version:
- $Rev: 437314 $
- Author:
- Apache Directory Project
Method Summary |
boolean |
canVisit(ExprNode node)
|
java.util.ArrayList |
getOrder(BranchNode node,
java.util.ArrayList children)
|
boolean |
isPrefix()
|
void |
visit(ExprNode node)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NormalizingVisitor
public NormalizingVisitor(NameComponentNormalizer ncn,
OidRegistry registry)
visit
public void visit(ExprNode node)
canVisit
public boolean canVisit(ExprNode node)
isPrefix
public boolean isPrefix()
getOrder
public java.util.ArrayList getOrder(BranchNode node,
java.util.ArrayList children)