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

public Class OctalUnescaper

extends CharSequenceTranslator
Class Inheritance
Imports
java.io.IOException, .Writer

Translate escaped octal Strings back to their octal values. For example, "\45" should go back to being the specific value (a %). Note that this currently only supports the viable range of octal for Java; namely 1 to 377. This is because parsing Java is the main use case.
Since
1.0

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
OctalUnescaper()

Creates a new instance.

Method Summary

Modifier and TypeMethod and Description
private boolean

Returns:

true if the given char is the character representation of one of the digits from 0 to 7.
isOctalDigit
(final char
the char to check.
ch
)

Tests if the given char is an octal digit.

private boolean

Returns:

true if the given char is the character representation of one of the digits from 0 to 3.
isZeroToThree
(final char
the char to check.
ch
)

Tests if the given char is the character representation of one of the digit from 0 to 3.

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.

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

Constructor Detail

OctalUnescaperback to summary
public OctalUnescaper()

Creates a new instance.

Method Detail

isOctalDigitback to summary
private boolean isOctalDigit(final char ch)

Tests if the given char is an octal digit. Octal digits are the character representations of the digits 0 to 7.

Parameters
ch:char

the char to check.

Returns:boolean

true if the given char is the character representation of one of the digits from 0 to 7.

isZeroToThreeback to summary
private boolean isZeroToThree(final char ch)

Tests if the given char is the character representation of one of the digit from 0 to 3.

Parameters
ch:char

the char to check.

Returns:boolean

true if the given char is the character representation of one of the digits from 0 to 3.

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.