Package org.ldaptive.dn
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 Summary
Constructors Constructor Description AbstractAttributeValueEscaper()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
escape(String value)
Escapes the supplied attribute value.protected void
escapeHex(StringBuilder sb, char... hex)
Appends a backslash for every two hex characters.protected abstract void
processAscii(StringBuilder sb, char ch)
Process ASCII character.protected abstract void
processNonAscii(StringBuilder sb, byte... bytes)
Process non-ASCII character(s).
-
-
-
Method Detail
-
escape
public String escape(String value)
Description copied from interface:AttributeValueEscaper
Escapes the supplied attribute value.- Specified by:
escape
in interfaceAttributeValueEscaper
- Parameters:
value
- to escape- Returns:
- escaped value
-
processAscii
protected abstract void processAscii(StringBuilder sb, char ch)
Process ASCII character.- Parameters:
sb
- to append characters toch
- to process
-
processNonAscii
protected abstract void processNonAscii(StringBuilder sb, byte... bytes)
Process non-ASCII character(s).- Parameters:
sb
- to append characters tobytes
- to process
-
escapeHex
protected void escapeHex(StringBuilder sb, char... hex)
Appends a backslash for every two hex characters.- Parameters:
sb
- to append tohex
- to read
-
-