public abstract class AbstractEscaper extends Object implements Escaper
Constructor and Description |
---|
AbstractEscaper() |
Modifier and Type | Method and Description |
---|---|
protected StringBuilder |
escape(CharSequence text)
Escapes the characters in a
CharSequence . |
String |
escape(String text)
Escape all special characters in a string.
|
StringBuilder |
escape(StringBuilder text)
Escape all special characters in a string buffer.
|
String |
escapeChar(char c)
Returns the escape sequence for the character, or
null . |
protected abstract Map<Character,String> |
getEscapeMap()
Returns the map from
Character s to their escape sequence strings. |
public String escapeChar(char c)
null
. This implementation
calls getEscapeMap
and looks up the character in the map.escapeChar
in interface Escaper
null
if no escaping is
neccessary.protected abstract Map<Character,String> getEscapeMap()
Character
s to their escape sequence strings.
Subclasses typically return a Map
instance which is a static final
member of the class.public StringBuilder escape(StringBuilder text)
protected StringBuilder escape(CharSequence text)
CharSequence
.StringBuilder
containing the escaped text sequence, or
null
if no characters needed escaping.Copyright © 2001-2013 the JGloss developers. All Rights Reserved.