|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.directory.api.ldap.model.filter.BranchNormalizedVisitor
public class BranchNormalizedVisitor
Visitor which traverses a filter tree while normalizing the branch node order. Filter expressions can change the order of expressions in branch nodes without effecting the logical meaning of the expression. This visitor orders the children of expression tree branch nodes consistantly. It is really useful for comparing expression trees which may be altered for performance or altered because of codec idiosyncracies: for example the SNACC4J codec uses a hashmap to store expressions in a sequence which rearranges the order of children based on object hashcodes. We need this visitor to remove such inconsitancies in order hence normalizing the branch node's child order.
| Constructor Summary | |
|---|---|
BranchNormalizedVisitor()
|
|
| Method Summary | |
|---|---|
boolean |
canVisit(ExprNode node)
Checks to see if a node can be visited. |
static String |
getNormalizedFilter(ExprNode filter)
Normalizes a filter expression to a canonical representation while retaining logical meaning of the expression. |
static String |
getNormalizedFilter(SchemaManager schemaManager,
String filter)
Normalizes a filter expression to a canonical representation while retaining logical meaning of the expression. |
List<ExprNode> |
getOrder(BranchNode node,
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. |
Object |
visit(ExprNode node)
Visits a filter expression AST using a specific visitation order. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BranchNormalizedVisitor()
| Method Detail |
|---|
public Object visit(ExprNode node)
FilterVisitor
visit in interface FilterVisitornode - the node to visit
public boolean canVisit(ExprNode node)
FilterVisitor
canVisit in interface FilterVisitornode - the node to be visited
public boolean isPrefix()
FilterVisitor
isPrefix in interface FilterVisitor
public List<ExprNode> getOrder(BranchNode node,
List<ExprNode> children)
FilterVisitor
getOrder in interface FilterVisitornode - the parent branch nodechildren - the child node array
public static String getNormalizedFilter(SchemaManager schemaManager,
String filter)
throws ParseException
filter - the filter to normalize
ParseException - if the filter is malformedpublic static String getNormalizedFilter(ExprNode filter)
filter - the filter to normalize
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||