public final class HTMLUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
convertCharacterEntities(java.lang.String s)
Converts all inline HTML character entities (c.f.,
http://www.w3.org/TR/REC-html40/sgml/entities.html)
to their Unicode character counterparts, if possible.
|
static java.lang.String |
escapeHTML(java.lang.String s)
Escape characters that are special in HTML, so that the resulting
string can be included in HTML (or XML).
|
static java.lang.String |
makeCharacterEntities(java.lang.String s)
Converts appropriate Unicode characters to their HTML character entity
counterparts (c.f.,
http://www.w3.org/TR/REC-html40/sgml/entities.html).
|
static java.lang.String |
stripHTMLTags(java.lang.String s)
Removes all HTML element tags from a string, leaving just the character
data.
|
static java.lang.String |
textFromHTML(java.lang.String s)
Convenience method to convert embedded HTML to text.
|
public static java.lang.String stripHTMLTags(java.lang.String s)
convertCharacterEntities()
to convert HTML character entity codes.s
- the string to adjustconvertCharacterEntities(java.lang.String)
public static java.lang.String escapeHTML(java.lang.String s)
s
- the string to convertpublic static java.lang.String convertCharacterEntities(java.lang.String s)
s
- the string to convertstripHTMLTags(java.lang.String)
,
makeCharacterEntities(java.lang.String)
public static java.lang.String makeCharacterEntities(java.lang.String s)
s
- the string to convertstripHTMLTags(java.lang.String)
,
convertCharacterEntities(java.lang.String)
public static java.lang.String textFromHTML(java.lang.String s)
#stripHTMLTags()
convertCharacterEntities()
to convert HTML entity codes to appropriate Unicode characters.
s
- the string to parseconvertCharacterEntities(java.lang.String)
,
stripHTMLTags(java.lang.String)