Package org.ldaptive.dn
Class AbstractAttributeValueEscaper
java.lang.Object
org.ldaptive.dn.AbstractAttributeValueEscaper
- All Implemented Interfaces:
AttributeValueEscaper
- Direct Known Subclasses:
DefaultAttributeValueEscaper,MinimalAttributeValueEscaper
Escapes an attribute value per RFC 4514 section 2.4. Implementations must decide how to handle unspecified
characters.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEscapes the supplied attribute value.protected voidescapeHex(StringBuilder sb, char... hex) Appends a backslash for every two hex characters.protected abstract voidprocessAscii(StringBuilder sb, char ch) Process ASCII character.protected abstract voidprocessNonAscii(StringBuilder sb, byte... bytes) Process non-ASCII character(s).
-
Constructor Details
-
AbstractAttributeValueEscaper
public AbstractAttributeValueEscaper()
-
-
Method Details
-
escape
Description copied from interface:AttributeValueEscaperEscapes the supplied attribute value.- Specified by:
escapein interfaceAttributeValueEscaper- Parameters:
value- to escape- Returns:
- escaped value
-
processAscii
Process ASCII character.- Parameters:
sb- to append characters toch- to process
-
processNonAscii
Process non-ASCII character(s).- Parameters:
sb- to append characters tobytes- to process
-
escapeHex
Appends a backslash for every two hex characters.- Parameters:
sb- to append tohex- to read
-