public final class CharEntities extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CharEntities.Entry
Associates a character to its entity name.
|
static class |
CharEntities.EntryComparator |
Modifier and Type | Field and Description |
---|---|
static CharEntities.EntryComparator |
COMPARE_BY_ENTITY_NAME |
Constructor and Description |
---|
CharEntities()
Constructs an empty map.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String name,
char c)
Adds an entry for specified entity name and character.
|
CharEntities.Entry[] |
getAll()
Returns all entries contained in this map.
|
int |
getChar(String name)
Returns the character corresponding to specified entity name.
|
static CharEntities |
getDocBookInstance()
Returns the map containing all characters entities defined in the
DocBook V4.5 DTD.
|
static CharEntities |
getHTMLInstance()
Returns the map containing all characters entities defined in the
XHTML 1.0 Transitional DTD.
|
String |
getName(char c)
Returns the entity name of specified character.
|
static void |
load(URL url,
CharEntities charEntities)
Loads character entities defined in the specified Java properties file.
|
int |
size()
Returns the number of entries contained in this map.
|
public static final CharEntities.EntryComparator COMPARE_BY_ENTITY_NAME
public void add(String name, char c)
CharEntities.Entry
public String getName(char c)
null
if specified character is not found in this map.public int getChar(String name)
public int size()
public CharEntities.Entry[] getAll()
public static CharEntities getDocBookInstance()
The returned map should not be modified.
public static void load(URL url, CharEntities charEntities) throws IOException
url
- URL of a Java properties file containing the definitions
of character entities (example: aleph=ℵ)charEntities
- the character entities found in the above file
are added to this setIOException
- if there is an I/O problempublic static CharEntities getHTMLInstance()
The returned map should not be modified.