private static class StringEscapeUtils.OctalUnescaper extends StringEscapeUtils.CharSequenceTranslator
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.
Modifier | Constructor and Description |
---|---|
private |
OctalUnescaper() |
Modifier and Type | Method and Description |
---|---|
private boolean |
isOctalDigit(char ch)
Checks if the given char is an octal digit.
|
private boolean |
isZeroToThree(char ch)
Checks if the given char is the character representation of one of the digit from 0 to 3.
|
int |
translate(java.lang.CharSequence input,
int index,
java.io.Writer out)
Translate a set of codepoints, represented by an int index into a CharSequence,
into another set of codepoints.
|
translate, translate, with
public int translate(java.lang.CharSequence input, int index, java.io.Writer out) throws java.io.IOException
translate
in class StringEscapeUtils.CharSequenceTranslator
input
- CharSequence that is being translatedindex
- int representing the current point of translationout
- Writer to translate the text tojava.io.IOException
- if and only if the Writer produces an IOExceptionprivate boolean isOctalDigit(char ch)
ch
- the char to checkprivate boolean isZeroToThree(char ch)
ch
- the char to check