Top Description Fields Constructors Methods
org.apache.commons.text.translate

pack-priv abstract Class SinglePassTranslator

extends CharSequenceTranslator
Class Inheritance
Known Direct Subclasses
org.apache.commons.text.translate.CsvTranslators.CsvEscaper, org.apache.commons.text.translate.CsvTranslators.CsvUnescaper
Imports
java.io.IOException, .Writer

Abstract translator for processing whole input in single pass. Handles initial index checking and counting of returned code points.

Field Summary

Inherited from org.apache.commons.text.translate.CharSequenceTranslator:
HEX_DIGITS

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private String

Returns:

The name of this or the extending class.
getClassName
()

A utility method to be used in the translate(CharSequence, int, Writer) method.

public int
translate(final CharSequence input, final int index, final Writer writer)

Implements abstract org.apache.commons.text.translate.CharSequenceTranslator.translate.

Translate a set of code points, represented by an int index into a CharSequence, into another set of code points.

pack-priv abstract void
translateWhole(CharSequence
CharSequence that is being translated.
input
,
Writer
Writer to translate the text to.
writer
)

Translates whole set of code points passed in input.

Inherited from org.apache.commons.text.translate.CharSequenceTranslator:
hextranslatetranslatewith

Constructor Detail

SinglePassTranslatorback to summary
pack-priv SinglePassTranslator()

Method Detail

getClassNameback to summary
private String getClassName()

A utility method to be used in the translate(CharSequence, int, Writer) method.

Returns:String

The name of this or the extending class.

translateback to summary
public int translate(final CharSequence input, final int index, final Writer writer) throws IOException

Implements abstract org.apache.commons.text.translate.CharSequenceTranslator.translate.

Doc from org.apache.commons.text.translate.CharSequenceTranslator.translate.

Translate a set of code points, represented by an int index into a CharSequence, into another set of code points. The number of code points 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.

Annotations
@Override
Exceptions
IOException:
if and only if the Writer produces an IOException.
IllegalArgumentException:
if index != 0.
translateWholeback to summary
pack-priv abstract void translateWhole(CharSequence input, Writer writer) throws IOException

Translates whole set of code points passed in input.

Parameters
input:CharSequence

CharSequence that is being translated.

writer:Writer

Writer to translate the text to.

Exceptions
IOException:
if and only if the Writer produces an IOException.