org.apache.directory.shared.ldap.filter
Class AssertionNode

java.lang.Object
  extended by org.apache.directory.shared.ldap.filter.AbstractExprNode
      extended by org.apache.directory.shared.ldap.filter.AssertionNode
All Implemented Interfaces:
ExprNode

public class AssertionNode
extends AbstractExprNode

Node used for the application of arbitrary predicates on return candidates. Applies dynamic and programatic criteria for the selection of candidates for return. Nodes of this type may be introduced into the filter expression to provided the opportunity to constrain the search further without altering the search algorithm.

Version:
$Revision: 664290 $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.filter.AbstractExprNode
annotations, assertionType
 
Constructor Summary
AssertionNode(Assertion assertion)
          Creates an AssertionNode using an arbitrary candidate assertion.
AssertionNode(Assertion assertion, java.lang.String desc)
          Creates an AssertionNode using an arbitrary candidate assertion with a descriptions used for filter AST walker dumps.
 
Method Summary
 java.lang.Object accept(FilterVisitor visitor)
          Element/node accept method for visitor pattern.
 Assertion getAssertion()
          Gets the Assertion used by this assertion node.
 int hashCode()
           
 boolean isLeaf()
          Always returns true since an AssertionNode has no children.
 java.lang.StringBuilder printRefinementToBuffer(java.lang.StringBuilder buf)
          Default implementation for this method : just throw an exception.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.directory.shared.ldap.filter.AbstractExprNode
equals, get, getAnnotations, getAssertionType, set
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AssertionNode

public AssertionNode(Assertion assertion)
Creates an AssertionNode using an arbitrary candidate assertion.

Parameters:
assertion - the arbitrary selection logic.

AssertionNode

public AssertionNode(Assertion assertion,
                     java.lang.String desc)
Creates an AssertionNode using an arbitrary candidate assertion with a descriptions used for filter AST walker dumps.

Parameters:
assertion - the arbitrary selection logic.
desc - the printout representation for filter prints.
Method Detail

getAssertion

public Assertion getAssertion()
Gets the Assertion used by this assertion node.

Returns:
the assertion used by this node

isLeaf

public boolean isLeaf()
Always returns true since an AssertionNode has no children.

Specified by:
isLeaf in interface ExprNode
Specified by:
isLeaf in class AbstractExprNode
Returns:
true if the node is a leaf,false otherwise
See Also:
ExprNode.isLeaf()

printRefinementToBuffer

public java.lang.StringBuilder printRefinementToBuffer(java.lang.StringBuilder buf)
                                                throws java.lang.UnsupportedOperationException
Description copied from class: AbstractExprNode
Default implementation for this method : just throw an exception.

Specified by:
printRefinementToBuffer in interface ExprNode
Overrides:
printRefinementToBuffer in class AbstractExprNode
Parameters:
buf - the buffer to append to.
Returns:
The buffer in which the refinement has been appended
Throws:
java.lang.UnsupportedOperationException - if this node isn't a part of a refinement.
See Also:
ExprNode.printRefinementToBuffer(StringBuilder)

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractExprNode
Returns:
the instance's hash code
See Also:
Object.hashCode()

accept

public java.lang.Object accept(FilterVisitor visitor)
Description copied from interface: ExprNode
Element/node accept method for visitor pattern.

Parameters:
visitor - the filter expression tree structure visitor TODO - what is this modified element ?
Returns:
the modified element
See Also:
ExprNode.accept( org.apache.directory.shared.ldap.filter.FilterVisitor)

toString

public java.lang.String toString()
Overrides:
toString in class AbstractExprNode
Returns:
A string representing the AndNode
See Also:
Object.toString()


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.