public class NumericUnescaper extends CharSequenceTranslator
Note that the semi-colon is optional.
| Modifier and Type | Class and Description |
|---|---|
static class |
NumericUnescaper.OPTION
NumericUnescaper option enum.
|
| Constructor and Description |
|---|
NumericUnescaper(NumericUnescaper.OPTION... options)
Create a UnicodeUnescaper.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isSet(NumericUnescaper.OPTION option)
Whether the passed in option is currently set.
|
int |
translate(CharSequence input,
int index,
Writer out)
Translate a set of codepoints, represented by an int index into a CharSequence,
into another set of codepoints.
|
hex, translate, translate, withpublic NumericUnescaper(NumericUnescaper.OPTION... options)
The constructor takes a list of options, only one type of which is currently available (whether to allow, error or ignore the semi-colon on the end of a numeric entity to being missing).
For example, to support numeric entities without a ';': new NumericUnescaper(NumericUnescaper.OPTION.semiColonOptional) and to throw an IllegalArgumentException when they're missing: new NumericUnescaper(NumericUnescaper.OPTION.errorIfNoSemiColon)
Note that the default behaviour is to ignore them.
options - to apply to this unescaperpublic boolean isSet(NumericUnescaper.OPTION option)
option - to check state ofpublic int translate(CharSequence input, int index, Writer out) throws IOException
CharSequenceTranslatortranslate in class CharSequenceTranslatorinput - CharSequence that is being translatedindex - int representing the current point of translationout - Writer to translate the text toIOException - if and only if the Writer produces an IOExceptionCopyright © 2019. All rights reserved.