|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.lang3.text.translate.CharSequenceTranslator
public abstract class CharSequenceTranslator
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.
Constructor Summary | |
---|---|
CharSequenceTranslator()
|
Method Summary | |
---|---|
static String |
hex(int codepoint)
Returns an upper case hexadecimal String for the given
character. |
String |
translate(CharSequence input)
Helper for non-Writer usage. |
abstract int |
translate(CharSequence input,
int index,
Writer out)
Translate a set of codepoints, represented by an int index into a CharSequence, into another set of codepoints. |
void |
translate(CharSequence input,
Writer out)
Translate an input onto a Writer. |
CharSequenceTranslator |
with(CharSequenceTranslator... translators)
Helper method to create a merger of this translator with another set of translators. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CharSequenceTranslator()
Method Detail |
---|
public abstract int translate(CharSequence input, int index, Writer out) throws IOException
input
- CharSequence that is being translatedindex
- int representing the current point of translationout
- Writer to translate the text to
IOException
- if and only if the Writer produces an IOExceptionpublic final String translate(CharSequence input)
input
- CharSequence to be translated
public final void translate(CharSequence input, Writer out) throws IOException
input
- CharSequence that is being translatedout
- Writer to translate the text to
IOException
- if and only if the Writer produces an IOExceptionpublic final CharSequenceTranslator with(CharSequenceTranslator... translators)
translators
- CharSequenceTranslator array of translators to merge with this one
public static String hex(int codepoint)
Returns an upper case hexadecimal String
for the given
character.
codepoint
- The codepoint to convert.
String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |