Class LeafNode
java.lang.Object
org.apache.directory.api.ldap.model.filter.AbstractExprNode
org.apache.directory.api.ldap.model.filter.LeafNode
- Direct Known Subclasses:
ExtensibleNode, PresenceNode, SimpleNode, SubstringNode
Abstract base class for leaf nodes within the expression filter tree.
- Author:
- Apache Directory Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringattribute on which this leaf is basedprotected AttributeTypeattributeType on which this leaf is basedFields inherited from class AbstractExprNode
annotations, assertionType -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLeafNode(String attribute, AssertionType assertionType) Creates a leaf node.protectedLeafNode(AttributeType attributeType, AssertionType assertionType) Creates a leaf node. -
Method Summary
Modifier and TypeMethodDescriptionfinal Objectaccept(FilterVisitor visitor) Element/node accept method for visitor pattern.booleanprotected static StringescapeFilterValue(String value) Handles the escaping of special characters in LDAP search filter assertion values using the <valueencoding> rule as described in RFC 4515.protected static StringescapeFilterValue(AttributeType attributeType, byte[] value) Handles the escaping of special characters in LDAP search filter assertion values using the <valueencoding> rule as described in RFC 4515.final StringGets the attribute this leaf node is based on.final AttributeTypeGets the attributeType this leaf node is based on.inthashCode()final booleanisLeaf()Gets whether this node is a leaf - the answer is always true here.booleanTells if this Node is Schema aware.voidsetAttribute(String attribute) Sets the attribute this leaf node is based on.voidsetAttributeType(AttributeType attributeType) Sets the attributeType this leaf node is based on.Methods inherited from class AbstractExprNode
clone, get, getAnnotations, getAssertionType, printRefinementToBuffer, set, toString
-
Field Details
-
attributeType
attributeType on which this leaf is based -
attribute
attribute on which this leaf is based
-
-
Constructor Details
-
LeafNode
Creates a leaf node.- Parameters:
attributeType- the attribute this node is based onassertionType- the type of this leaf node
-
LeafNode
Creates a leaf node.- Parameters:
attribute- the attribute this node is based onassertionType- the type of this leaf node
-
-
Method Details
-
isLeaf
public final boolean isLeaf()Gets whether this node is a leaf - the answer is always true here.- Returns:
- true always
-
getAttributeType
Gets the attributeType this leaf node is based on.- Returns:
- the attributeType asserted
-
getAttribute
Gets the attribute this leaf node is based on.- Returns:
- the attribute asserted
-
setAttributeType
Sets the attributeType this leaf node is based on.- Parameters:
attributeType- the attributeType that is asserted by this filter node
-
setAttribute
Sets the attribute this leaf node is based on.- Parameters:
attribute- the attribute that is asserted by this filter node
-
accept
Description copied from interface:ExprNodeElement/node accept method for visitor pattern.- Parameters:
visitor- the filter expression tree structure visitor- Returns:
- The modified element
- See Also:
-
isSchemaAware
public boolean isSchemaAware()Tells if this Node is Schema aware.- Returns:
- true if the Node is SchemaAware
-
escapeFilterValue
Handles the escaping of special characters in LDAP search filter assertion values using the <valueencoding> rule as described in RFC 4515. Needed so thatExprNode.printRefinementToBuffer(StringBuilder)results in a valid filter string that can be parsed again (as a way of cloning filters).- Parameters:
attributeType- The associatedAttributeTypevalue- Right hand side of "attrId=value" assertion occurring in an LDAP search filter.- Returns:
- Escaped version of
value
-
escapeFilterValue
Handles the escaping of special characters in LDAP search filter assertion values using the <valueencoding> rule as described in RFC 4515. Needed so thatExprNode.printRefinementToBuffer(StringBuilder)results in a valid filter string that can be parsed again (as a way of cloning filters).- Parameters:
value- Right hand side of "attrId=value" assertion occurring in an LDAP search filter.- Returns:
- Escaped version of
value
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractExprNode- Returns:
- the instance's hash code
- See Also:
-
equals
- Overrides:
equalsin classAbstractExprNode- Returns:
trueif both objects are equal- See Also:
-