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

java.lang.Object
  extended byorg.apache.directory.shared.ldap.filter.AbstractExprNode
      extended byorg.apache.directory.shared.ldap.filter.LeafNode
          extended byorg.apache.directory.shared.ldap.filter.SubstringNode
All Implemented Interfaces:
ExprNode

public class SubstringNode
extends LeafNode

Filter expression tree node used to represent a substring assertion.

Version:
$Revision: 379008 $
Author:
Alex Karasulu, $author$

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.filter.AbstractExprNode
AND, APPROXIMATE, ASSERTION, EQUALITY, EXTENSIBLE, GREATEREQ, LESSEQ, NOT, OR, PRESENCE, SCOPE, SUBSTRING
 
Constructor Summary
SubstringNode(java.util.ArrayList anyPattern, java.lang.String attribute, java.lang.String initialPattern, java.lang.String finalPattern)
          Creates a new SubstringNode object more than one wildcard and an any list.
SubstringNode(java.lang.String attribute, java.lang.String initialPattern, java.lang.String finalPattern)
          Creates a new SubstringNode object with only one wildcard and no internal any fragments between wildcards.
 
Method Summary
 void accept(FilterVisitor a_visitor)
          Element/node accept method for visitor pattern.
 java.util.List getAny()
          Gets the list of wildcard surrounded any fragments.
 java.lang.String getFinal()
          Gets the final fragment or suffix.
 java.lang.String getInitial()
          Gets the initial fragment.
 java.util.regex.Pattern getRegex(Normalizer normalizer)
          Gets the compiled regular expression for the substring expression.
 java.lang.StringBuffer printToBuffer(java.lang.StringBuffer buf)
          Recursively appends this String representation of this node and its descendents in prefix notation to a buffer.
 java.lang.String toString()
           
 
Methods inherited from class org.apache.directory.shared.ldap.filter.LeafNode
equals, getAttribute, isLeaf
 
Methods inherited from class org.apache.directory.shared.ldap.filter.AbstractExprNode
get, getAnnotations, getAssertionType, getOperationString, set
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SubstringNode

public SubstringNode(java.lang.String attribute,
                     java.lang.String initialPattern,
                     java.lang.String finalPattern)
Creates a new SubstringNode object with only one wildcard and no internal any fragments between wildcards.


SubstringNode

public SubstringNode(java.util.ArrayList anyPattern,
                     java.lang.String attribute,
                     java.lang.String initialPattern,
                     java.lang.String finalPattern)
Creates a new SubstringNode object more than one wildcard and an any list.

Method Detail

getInitial

public final java.lang.String getInitial()
Gets the initial fragment.

Returns:
the initial prefix

getFinal

public final java.lang.String getFinal()
Gets the final fragment or suffix.

Returns:
the suffix

getAny

public final java.util.List getAny()
Gets the list of wildcard surrounded any fragments.

Returns:
the any fragments

getRegex

public final java.util.regex.Pattern getRegex(Normalizer normalizer)
                                       throws java.util.regex.PatternSyntaxException,
                                              javax.naming.NamingException
Gets the compiled regular expression for the substring expression.

Returns:
the equivalent compiled regular expression
Throws:
RESyntaxException - if the regular expression is invalid
java.util.regex.PatternSyntaxException
javax.naming.NamingException

toString

public java.lang.String toString()
See Also:
Object.toString()

printToBuffer

public java.lang.StringBuffer printToBuffer(java.lang.StringBuffer buf)
Description copied from interface: ExprNode
Recursively appends this String representation of this node and its descendents in prefix notation to a buffer.

Parameters:
buf - the buffer to append to.
See Also:
ExprNode.printToBuffer(java.lang.StringBuffer)

accept

public void accept(FilterVisitor a_visitor)
Description copied from interface: ExprNode
Element/node accept method for visitor pattern.

Parameters:
a_visitor - the filter expression tree structure visitor
See Also:
ExprNode.accept( org.apache.directory.shared.ldap.filter.FilterVisitor)


Copyright © 2003-2006 . All Rights Reserved.