public class Sgml extends Object
Sgml class contains static methods for processing SGML
into unicode characters. There is a method entityToCharacter(String)
which returns the unicode character corresponding to an SGML entity. There
is also a method replaceEntities(String,String) which performs
a substitution for entities in an input string.
See the following document for a complete list of over 1000 entities known by this class:
| Modifier and Type | Method and Description |
|---|---|
static Character |
entityToCharacter(String entity)
Returns the character represented by the specified SGML entity,
or
null if the entity is undefined. |
static String |
replaceEntities(String in)
Convenience method to call
replaceEntities(String,String)
with the question marked used for unknown entities. |
static String |
replaceEntities(String in,
String unknownReplacement)
Returns the result of replacing all the entities appearing
in the specified string with their corresponding unicode
characters, using the specified replacement string for
unknown entities.
|
public static Character entityToCharacter(String entity)
null if the entity is undefined. Note that the
SGML entity should be passed in without its preceding ampersand
or following semicolon.entity - Name of SGML entity (without initial ampersand
and final semicolon).null if
it is undefined.public static String replaceEntities(String in, String unknownReplacement)
in - Input string.unknownReplacement - String with which to replace unknown
entities.public static String replaceEntities(String in)
replaceEntities(String,String)
with the question marked used for unknown entities.in - Input string.Copyright © 2019 Alias-i, Inc.. All rights reserved.