|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.directory.server.core.normalization.NormalizingVisitor
public class NormalizingVisitor
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.
Constructor Summary | |
---|---|
NormalizingVisitor(org.apache.directory.shared.ldap.name.NameComponentNormalizer ncn,
Registries registries)
Creates a new instance of NormalizingVisitor. |
Method Summary | |
---|---|
boolean |
canVisit(org.apache.directory.shared.ldap.filter.ExprNode node)
|
java.util.List<org.apache.directory.shared.ldap.filter.ExprNode> |
getOrder(org.apache.directory.shared.ldap.filter.BranchNode node,
java.util.List<org.apache.directory.shared.ldap.filter.ExprNode> children)
|
static boolean |
isFilterChar(char c)
Check if the given char is a filter escaped char <filterEscapedChars> ::= '\0' | '(' | ')' | '*' | '\' |
boolean |
isPrefix()
|
java.lang.Object |
visit(org.apache.directory.shared.ldap.filter.ExprNode node)
Visit the tree, normalizing the leaves and recusrsively visit the branches. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NormalizingVisitor(org.apache.directory.shared.ldap.name.NameComponentNormalizer ncn, Registries registries)
ncn
- The name component normalizer to useregistries
- The global registriesMethod Detail |
---|
public static boolean isFilterChar(char c)
c
- the char we want to test
public java.lang.Object visit(org.apache.directory.shared.ldap.filter.ExprNode node)
visit
in interface org.apache.directory.shared.ldap.filter.FilterVisitor
node
- the node to visit
public boolean canVisit(org.apache.directory.shared.ldap.filter.ExprNode node)
canVisit
in interface org.apache.directory.shared.ldap.filter.FilterVisitor
public boolean isPrefix()
isPrefix
in interface org.apache.directory.shared.ldap.filter.FilterVisitor
public java.util.List<org.apache.directory.shared.ldap.filter.ExprNode> getOrder(org.apache.directory.shared.ldap.filter.BranchNode node, java.util.List<org.apache.directory.shared.ldap.filter.ExprNode> children)
getOrder
in interface org.apache.directory.shared.ldap.filter.FilterVisitor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |