Class LeafNode

    • Field Detail

      • attributeType

        protected AttributeType attributeType
        attributeType on which this leaf is based
      • attribute

        protected String attribute
        attribute on which this leaf is based
    • Constructor Detail

      • LeafNode

        protected LeafNode​(AttributeType attributeType,
                           AssertionType assertionType)
        Creates a leaf node.
        Parameters:
        attributeType - the attribute this node is based on
        assertionType - the type of this leaf node
      • LeafNode

        protected LeafNode​(String attribute,
                           AssertionType assertionType)
        Creates a leaf node.
        Parameters:
        attribute - the attribute this node is based on
        assertionType - the type of this leaf node
    • Method Detail

      • isLeaf

        public final boolean isLeaf()
        Gets whether this node is a leaf - the answer is always true here.
        Returns:
        true always
      • getAttributeType

        public final AttributeType getAttributeType()
        Gets the attributeType this leaf node is based on.
        Returns:
        the attributeType asserted
      • getAttribute

        public final String getAttribute()
        Gets the attribute this leaf node is based on.
        Returns:
        the attribute asserted
      • setAttributeType

        public void setAttributeType​(AttributeType attributeType)
        Sets the attributeType this leaf node is based on.
        Parameters:
        attributeType - the attributeType that is asserted by this filter node
      • setAttribute

        public void setAttribute​(String attribute)
        Sets the attribute this leaf node is based on.
        Parameters:
        attribute - the attribute that is asserted by this filter node
      • accept

        public final Object accept​(FilterVisitor visitor)
        Description copied from interface: ExprNode
        Element/node accept method for visitor pattern.
        Parameters:
        visitor - the filter expression tree structure visitor
        Returns:
        The modified element
        See Also:
        ExprNode.accept( FilterVisitor)
      • isSchemaAware

        public boolean isSchemaAware()
        Tells if this Node is Schema aware.
        Returns:
        true if the Node is SchemaAware
      • escapeFilterValue

        protected static String escapeFilterValue​(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. Needed so that ExprNode.printRefinementToBuffer(StringBuilder) results in a valid filter string that can be parsed again (as a way of cloning filters).
        Parameters:
        attributeType - The associated AttributeType
        value - Right hand side of "attrId=value" assertion occurring in an LDAP search filter.
        Returns:
        Escaped version of value
      • escapeFilterValue

        protected static String escapeFilterValue​(String value)
        Handles the escaping of special characters in LDAP search filter assertion values using the <valueencoding> rule as described in RFC 4515. Needed so that ExprNode.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