Class AbstractAttributeValueEscaper

java.lang.Object
org.ldaptive.dn.AbstractAttributeValueEscaper
All Implemented Interfaces:
AttributeValueEscaper
Direct Known Subclasses:
DefaultAttributeValueEscaper, MinimalAttributeValueEscaper

public abstract class AbstractAttributeValueEscaper extends Object implements AttributeValueEscaper
Escapes an attribute value per RFC 4514 section 2.4. Implementations must decide how to handle unspecified characters.
  • Constructor Details

    • AbstractAttributeValueEscaper

      public AbstractAttributeValueEscaper()
  • Method Details

    • escape

      public String escape(String value)
      Description copied from interface: AttributeValueEscaper
      Escapes the supplied attribute value.
      Specified by:
      escape in interface AttributeValueEscaper
      Parameters:
      value - to escape
      Returns:
      escaped value
    • processAscii

      protected abstract void processAscii(StringBuilder sb, char ch)
      Process ASCII character.
      Parameters:
      sb - to append characters to
      ch - to process
    • processNonAscii

      protected abstract void processNonAscii(StringBuilder sb, byte... bytes)
      Process non-ASCII character(s).
      Parameters:
      sb - to append characters to
      bytes - to process
    • escapeHex

      protected void escapeHex(StringBuilder sb, char... hex)
      Appends a backslash for every two hex characters.
      Parameters:
      sb - to append to
      hex - to read