Class CharSequenceTranslator
java.lang.Object
org.apache.commons.lang3.text.translate.CharSequenceTranslator
- Direct Known Subclasses:
AggregateTranslator,CodePointTranslator,LookupTranslator,NumericEntityUnescaper,OctalUnescaper,StringEscapeUtils.CsvEscaper,StringEscapeUtils.CsvUnescaper,UnicodeUnescaper
Deprecated.
as of 3.6, use commons-text
CharSequenceTranslator instead
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.
- Since:
- 3.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringhex(int codepoint) Deprecated.Returns an upper case hexadecimalStringfor the given character.final Stringtranslate(CharSequence input) Deprecated.Helper for non-Writer usage.abstract inttranslate(CharSequence input, int index, Writer out) Deprecated.Translate a set of codepoints, represented by an int index into a CharSequence, into another set of codepoints.final voidtranslate(CharSequence input, Writer out) Deprecated.Translate an input onto a Writer.final CharSequenceTranslatorwith(CharSequenceTranslator... translators) Deprecated.Helper method to create a merger of this translator with another set of translators.
-
Field Details
-
HEX_DIGITS
static final char[] HEX_DIGITSDeprecated.
-
-
Constructor Details
-
CharSequenceTranslator
public CharSequenceTranslator()Deprecated.
-
-
Method Details
-
translate
Deprecated.Translate a set of codepoints, represented by an int index into a CharSequence, into another set of codepoints. The number of codepoints consumed must be returned, and the only IOExceptions thrown must be from interacting with the Writer so that the top level API may reliably ignore StringWriter IOExceptions.- Parameters:
input- CharSequence that is being translatedindex- int representing the current point of translationout- Writer to translate the text to- Returns:
- int count of codepoints consumed
- Throws:
IOException- if and only if the Writer produces an IOException
-
translate
Deprecated.Helper for non-Writer usage.- Parameters:
input- CharSequence to be translated- Returns:
- String output of translation
-
translate
Deprecated.Translate an input onto a Writer. This is intentionally final as its algorithm is tightly coupled with the abstract method of this class.- Parameters:
input- CharSequence that is being translatedout- Writer to translate the text to- Throws:
IOException- if and only if the Writer produces an IOException
-
with
Deprecated.Helper method to create a merger of this translator with another set of translators. Useful in customizing the standard functionality.- Parameters:
translators- CharSequenceTranslator array of translators to merge with this one- Returns:
- CharSequenceTranslator merging this translator with the others
-
hex
Deprecated.Returns an upper case hexadecimal
Stringfor the given character.- Parameters:
codepoint- The codepoint to convert.- Returns:
- An upper case hexadecimal
String
-