Class SubstringNode
java.lang.Object
org.apache.directory.api.ldap.model.filter.AbstractExprNode
org.apache.directory.api.ldap.model.filter.LeafNode
org.apache.directory.api.ldap.model.filter.SubstringNode
Filter expression tree node used to represent a substring assertion.
- Author:
- Apache Directory Project
-
Field Summary
Fields inherited from class LeafNode
attribute, attributeTypeFields inherited from class AbstractExprNode
annotations, assertionType -
Constructor Summary
ConstructorsConstructorDescriptionSubstringNode(String attributeType) Creates a new SubstringNode object without any valueSubstringNode(String attribute, String initialPattern, String finalPattern) Creates a new SubstringNode object with only one wildcard and no internal any fragments between wildcards.SubstringNode(List<String> anyPattern, String attribute, String initialPattern, String finalPattern) Creates a new SubstringNode object more than one wildcard and an any list.SubstringNode(List<String> anyPattern, AttributeType attributeType, String initialPattern, String finalPattern) Creates a new SubstringNode object more than one wildcard and an any list.SubstringNode(AttributeType attribute) Creates a new SubstringNode object without any valueSubstringNode(AttributeType attributeType, String initialPattern, String finalPattern) Creates a new SubstringNode object with only one wildcard and no internal any fragments between wildcards. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an any patternclone()Clone the NodebooleangetAny()Gets the list of wildcard surrounded any fragments.final StringgetFinal()Gets the final fragment or suffix.final StringGets the initial fragment.static PatternCreates a regular expression from an LDAP substring assertion filter specification.final PatterngetRegex(Normalizer normalizer) Gets the compiled regular expression for the substring expression.inthashCode()voidSet the any patternsvoidSet the final patternvoidsetInitial(String initialPattern) Set the initial patterntoString()Methods inherited from class LeafNode
accept, escapeFilterValue, escapeFilterValue, getAttribute, getAttributeType, isLeaf, isSchemaAware, setAttribute, setAttributeTypeMethods inherited from class AbstractExprNode
get, getAnnotations, getAssertionType, printRefinementToBuffer, set
-
Constructor Details
-
SubstringNode
Creates a new SubstringNode object with only one wildcard and no internal any fragments between wildcards.- Parameters:
attributeType- the name of the attributeType to substring assertinitialPattern- the initial fragmentfinalPattern- the final fragment
-
SubstringNode
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 assertinitialPattern- the initial fragmentfinalPattern- the final fragment
-
SubstringNode
Creates a new SubstringNode object without any value- Parameters:
attribute- the name of the attribute to substring assert
-
SubstringNode
Creates a new SubstringNode object without any value- Parameters:
attributeType- the attributeType to substring assert
-
SubstringNode
public SubstringNode(List<String> anyPattern, AttributeType attributeType, String initialPattern, String finalPattern) Creates a new SubstringNode object more than one wildcard and an any list.- Parameters:
anyPattern- list of internal fragments between wildcardsattributeType- the attributeType to substring assertinitialPattern- the initial fragmentfinalPattern- the final fragment
-
SubstringNode
public SubstringNode(List<String> anyPattern, String attribute, String initialPattern, String finalPattern) Creates a new SubstringNode object more than one wildcard and an any list.- Parameters:
anyPattern- list of internal fragments between wildcardsattribute- the name of the attribute to substring assertinitialPattern- the initial fragmentfinalPattern- the final fragment
-
-
Method Details
-
getRegex
Creates a regular expression from an LDAP substring assertion filter specification.- Parameters:
initialPattern- the initial fragment before wildcardsanyPattern- fragments surrounded by wildcards if anyfinalPattern- the final fragment after last wildcard if any- Returns:
- the regular expression for the substring match filter
- Throws:
PatternSyntaxException- if a syntactically correct regular expression cannot be compiled
-
clone
Clone the Node- Specified by:
clonein interfaceExprNode- Overrides:
clonein classAbstractExprNode- Returns:
- the cloned expression node
-
getInitial
-
setInitial
Set the initial pattern- Parameters:
initialPattern- The initial pattern
-
getFinal
-
setFinal
Set the final pattern- Parameters:
finalPattern- The final pattern
-
getAny
-
setAny
-
addAny
-
getRegex
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:
LdapException- if there are problems while normalizing
-
equals
-
hashCode
-
toString
- Overrides:
toStringin classAbstractExprNode- Returns:
- A string representing the AndNode
- See Also:
-