public final class HTMLUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
charsToEntities(java.lang.String str,
java.lang.String encoding,
java.util.Collection<java.lang.String> shortcuts)
Converts characters that must be converted (< > & ' ' (nbsp)) into HTML entities.
|
static java.lang.String |
entitiesToChars(java.lang.String str)
Converts HTML entities to normal characters
|
static boolean |
isDecimalDigit(int ch)
Returns true if a char is a decimal digit
|
static boolean |
isHexDigit(int ch)
Returns true if a char is a hex digit
|
static boolean |
isLatinLetter(int ch)
Returns true if a char is a latin letter
|
public static java.lang.String entitiesToChars(java.lang.String str)
public static boolean isLatinLetter(int ch)
public static boolean isDecimalDigit(int ch)
public static boolean isHexDigit(int ch)
public static java.lang.String charsToEntities(java.lang.String str, java.lang.String encoding, java.util.Collection<java.lang.String> shortcuts)
str
- The string to convertencoding
- The output encoding. May be null (all characters are assumed to be supported).shortcuts
- A collection of tag-like strings (<foo>
) that will be "protected", i.e. they will not be
escaped as entities.