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

public abstract Class CodePointTranslator

extends CharSequenceTranslator
Class Inheritance
Known Direct Subclasses
org.apache.commons.text.translate.NumericEntityEscaper, org.apache.commons.text.translate.UnicodeEscaper, org.apache.commons.text.translate.UnicodeUnpairedSurrogateRemover
Imports
java.io.IOException, .Writer

Helper subclass to CharSequenceTranslator to allow for translations that will replace up to one character at a time.
Since
1.0

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
CodePointTranslator()

Construct a new instance.

Method Summary

Modifier and TypeMethod and Description
public final 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.

public abstract boolean

Returns:

boolean as to whether translation occurred or not.
translate
(int
int character input to translate.
codePoint
,
Writer
Writer to optionally push the translated output to.
writer
)

Translates the specified code point into another.

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

Constructor Detail

CodePointTranslatorback to summary
public CodePointTranslator()

Construct a new instance.

Method Detail

translateback to summary
public final 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.
translateback to summary
public abstract boolean translate(int codePoint, Writer writer) throws IOException

Translates the specified code point into another.

Parameters
codePoint:int

int character input to translate.

writer:Writer

Writer to optionally push the translated output to.

Returns:boolean

boolean as to whether translation occurred or not.

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