org.apache.directory.server.core.event
Class ExpressionEvaluator

java.lang.Object
  extended by org.apache.directory.server.core.event.ExpressionEvaluator
All Implemented Interfaces:
Evaluator

public class ExpressionEvaluator
extends java.lang.Object
implements Evaluator

Top level filter expression evaluator implemenation.

Version:
$Rev: 434579 $
Author:
Apache Directory Project

Constructor Summary
ExpressionEvaluator(LeafEvaluator leafEvaluator)
          Creates a top level Evaluator where leaves are delegated to a leaf node evaluator which is already provided.
ExpressionEvaluator(OidRegistry oidRegistry, AttributeTypeRegistry attributeTypeRegistry)
          Creates a top level Evaluator where leaves are delegated to a leaf node evaluator which will be created.
 
Method Summary
 boolean evaluate(ExprNode node, java.lang.String dn, javax.naming.directory.Attributes entry)
          Evaluates a candidate to determine if a filter expression selects it.
 LeafEvaluator getLeafEvaluator()
          Gets the leaf evaluator used by this top level expression evaluator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionEvaluator

public ExpressionEvaluator(LeafEvaluator leafEvaluator)
Creates a top level Evaluator where leaves are delegated to a leaf node evaluator which is already provided.

Parameters:
leafEvaluator - handles leaf node evaluation.

ExpressionEvaluator

public ExpressionEvaluator(OidRegistry oidRegistry,
                           AttributeTypeRegistry attributeTypeRegistry)
                    throws javax.naming.NamingException
Creates a top level Evaluator where leaves are delegated to a leaf node evaluator which will be created.

Parameters:
oidRegistry - the oid reg used for attrID to oid resolution
attributeTypeRegistry - the attribtype reg used for value comparison
Throws:
javax.naming.NamingException
Method Detail

getLeafEvaluator

public LeafEvaluator getLeafEvaluator()
Gets the leaf evaluator used by this top level expression evaluator.

Returns:
the leaf evaluator used by this top level expression evaluator

evaluate

public boolean evaluate(ExprNode node,
                        java.lang.String dn,
                        javax.naming.directory.Attributes entry)
                 throws javax.naming.NamingException
Description copied from interface: Evaluator
Evaluates a candidate to determine if a filter expression selects it.

Specified by:
evaluate in interface Evaluator
Parameters:
node - the filter expression to evaluate on the candidate
dn - the normalized distinguished name of the entry being tested
entry - the entry to evaluate
Returns:
true if the filter selects the candidate false otherwise
Throws:
javax.naming.NamingException - if there is a database fault during evaluation
See Also:
Evaluator.evaluate(ExprNode, String, Attributes)