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)
将一组由int索引表示的代码点转换为CharSequence,
转换成另一组代码点 必须返回所使用的代码点数量,
|
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 - 正在翻译的CharSequenceindex - int表示当前翻译点out - Writer将文本翻译成IOException - 当写入器生成IOException时抛出IOExceptionCopyright © 2020. All rights reserved.