@Beta @GwtCompatible public final class CharEscaperBuilder extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
CharEscaperBuilder.CharArrayDecorator
Simple decorator that turns an array of replacement char[]s into a CharEscaper, this results in
a very fast escape method.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Character,java.lang.String> |
map |
private int |
max |
Constructor and Description |
---|
CharEscaperBuilder()
Construct a new sparse array builder.
|
Modifier and Type | Method and Description |
---|---|
CharEscaperBuilder |
addEscape(char c,
java.lang.String r)
Add a new mapping from an index to an object to the escaping.
|
CharEscaperBuilder |
addEscapes(char[] cs,
java.lang.String r)
Add multiple mappings at once for a particular index.
|
char[][] |
toArray()
Convert this builder into an array of char[]s where the maximum index is the value of the
highest character that has been seen.
|
Escaper |
toEscaper()
Convert this builder into a char escaper which is just a decorator around the underlying array
of replacement char[]s.
|
private final java.util.Map<java.lang.Character,java.lang.String> map
private int max
public CharEscaperBuilder()
public CharEscaperBuilder addEscape(char c, java.lang.String r)
public CharEscaperBuilder addEscapes(char[] cs, java.lang.String r)
public char[][] toArray()
public Escaper toEscaper()