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

java.lang.Object
  extended by org.apache.directory.shared.ldap.filter.AbstractExprNode
      extended by org.apache.directory.shared.ldap.filter.LeafNode
          extended by org.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: 664290 $
Author:
Apache Directory Project

Field Summary
 
Fields inherited from class org.apache.directory.shared.ldap.filter.AbstractExprNode
annotations, assertionType
 
Constructor Summary
SubstringNode(java.util.List<java.lang.String> 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)
          Creates a new SubstringNode object without any value
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 addAny(java.lang.String anyPattern)
          Add an any pattern
 java.util.List<java.lang.String> 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.
 int hashCode()
           
 void setAny(java.util.List<java.lang.String> anyPattern)
          Set the any patterns
 void setFinal(java.lang.String finalPattern)
          Set the final pattern
 void setInitial(java.lang.String initialPattern)
          Set the initial pattern
 java.lang.String toString()
           
 
Methods inherited from class org.apache.directory.shared.ldap.filter.LeafNode
accept, equals, getAttribute, isLeaf, setAttribute
 
Methods inherited from class org.apache.directory.shared.ldap.filter.AbstractExprNode
get, getAnnotations, getAssertionType, printRefinementToBuffer, set
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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.

Parameters:
attribute - the name of the attribute to substring assert
initialPattern - the initial fragment
finalPattern - the final fragment

SubstringNode

public SubstringNode(java.lang.String attribute)
Creates a new SubstringNode object without any value

Parameters:
attribute - the name of the attribute to substring assert

SubstringNode

public SubstringNode(java.util.List<java.lang.String> 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.

Parameters:
anyPattern - list of internal fragments between wildcards
attribute - the name of the attribute to substring assert
initialPattern - the initial fragment
finalPattern - the final fragment
Method Detail

getInitial

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

Returns:
the initial prefix

setInitial

public void setInitial(java.lang.String initialPattern)
Set the initial pattern

Parameters:
initialPattern - The initial pattern

getFinal

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

Returns:
the suffix

setFinal

public void setFinal(java.lang.String finalPattern)
Set the final pattern

Parameters:
finalPattern - The final pattern

getAny

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

Returns:
the any fragments

setAny

public void setAny(java.util.List<java.lang.String> anyPattern)
Set the any patterns

Parameters:
anyPattern - The any patterns

addAny

public void addAny(java.lang.String anyPattern)
Add an any pattern

Parameters:
anyPattern - The any pattern

getRegex

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

Parameters:
normalizer - the normalizer to use for pattern component normalization
Returns:
the equivalent compiled regular expression
Throws:
javax.naming.NamingException - if there are problems while normalizing

hashCode

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

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.