class HtmlCharacterEntityReferences
extends java.lang.Object
A complete description of the HTML 4.0 character set can be found at http://www.w3.org/TR/html4/charset.html.
Modifier and Type | Field and Description |
---|---|
(package private) static char |
CHAR_NULL |
private java.lang.String[] |
characterToEntityReferenceMap |
(package private) static java.lang.String |
DECIMAL_REFERENCE_START |
private java.util.Map<java.lang.String,java.lang.Character> |
entityReferenceToCharacterMap |
(package private) static java.lang.String |
HEX_REFERENCE_START |
private static java.lang.String |
PROPERTIES_FILE |
(package private) static char |
REFERENCE_END |
(package private) static char |
REFERENCE_START |
Constructor and Description |
---|
HtmlCharacterEntityReferences()
Returns a new set of character entity references reflecting the HTML 4.0 character set.
|
Modifier and Type | Method and Description |
---|---|
char |
convertToCharacter(java.lang.String entityReference)
Return the char mapped to the given entityReference or -1.
|
java.lang.String |
convertToReference(char character)
Return the reference mapped to the given character or
null . |
java.lang.String |
convertToReference(char character,
java.lang.String encoding)
Return the reference mapped to the given character or
null . |
int |
getSupportedReferenceCount()
Return the number of supported entity references.
|
boolean |
isMappedToReference(char character)
Return true if the given character is mapped to a supported entity reference.
|
boolean |
isMappedToReference(char character,
java.lang.String encoding)
Return true if the given character is mapped to a supported entity reference.
|
private static final java.lang.String PROPERTIES_FILE
static final char REFERENCE_START
static final java.lang.String DECIMAL_REFERENCE_START
static final java.lang.String HEX_REFERENCE_START
static final char REFERENCE_END
static final char CHAR_NULL
private final java.lang.String[] characterToEntityReferenceMap
private final java.util.Map<java.lang.String,java.lang.Character> entityReferenceToCharacterMap
public HtmlCharacterEntityReferences()
public int getSupportedReferenceCount()
public boolean isMappedToReference(char character)
public boolean isMappedToReference(char character, java.lang.String encoding)
@Nullable public java.lang.String convertToReference(char character)
null
.@Nullable public java.lang.String convertToReference(char character, java.lang.String encoding)
null
.public char convertToCharacter(java.lang.String entityReference)