private abstract static class StringEscapeUtils.CharSequenceTranslator
extends java.lang.Object
An API for translating text. Its core use is to escape and unescape text. Because escaping and unescaping is completely contextual, the API does not present two separate signatures.
Modifier | Constructor and Description |
---|---|
private |
CharSequenceTranslator() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
translate(java.lang.CharSequence input)
Helper for non-Writer usage.
|
abstract int |
translate(java.lang.CharSequence input,
int index,
java.io.Writer out)
Translate a set of codepoints, represented by an int index into a CharSequence,
into another set of codepoints.
|
void |
translate(java.lang.CharSequence input,
java.io.Writer out)
Translate an input onto a Writer.
|
StringEscapeUtils.CharSequenceTranslator |
with(StringEscapeUtils.CharSequenceTranslator... translators)
Helper method to create a merger of this translator with another set of
translators.
|
public abstract int translate(java.lang.CharSequence input, int index, java.io.Writer out) throws java.io.IOException
input
- CharSequence that is being translatedindex
- int representing the current point of translationout
- Writer to translate the text tojava.io.IOException
- if and only if the Writer produces an IOExceptionpublic final java.lang.String translate(java.lang.CharSequence input)
input
- CharSequence to be translatedpublic final void translate(java.lang.CharSequence input, java.io.Writer out) throws java.io.IOException
input
- CharSequence that is being translatedout
- Writer to translate the text tojava.io.IOException
- if and only if the Writer produces an IOExceptionpublic final StringEscapeUtils.CharSequenceTranslator with(StringEscapeUtils.CharSequenceTranslator... translators)
translators
- CharSequenceTranslator array of translators to merge with this one