Java Utililty Methods HTML Entity

List of utility methods to do HTML Entity

Description

The list of methods to do HTML Entity are organized into topic(s).

Method

StringcharToHtmlEntity(char entity)
char To Html Entity
return CHAR_TO_HTML_ENTITIES.get(entity);
StringhtmlEntities(String html)
html Entities
StringBuilder out = new StringBuilder(html.length() * 2);
for (int p = 0; p < html.length(); p++) {
    Character c = html.charAt(p);
    String entity = entityTable.get(c);
    if (entity != null)
        out.append(entity);
    else
        out.append(c);
...
StringremoveHtmlEntity(String content)
remove Html Entity
for (Map.Entry<String, Integer> entry : ENTITIES.entrySet()) {
    content = content.replaceAll("&" + entry.getKey() + ";", "");
return content;
StringreplaceHtmlEntitiesWithEmptyString(String stb)
replace Html Entities With Empty String
Iterator i$ = HTML_ENTITY_MAP.keySet().iterator();
do {
    if (!i$.hasNext())
        break;
    String key = (String) i$.next();
    if (stb.contains(key))
        stb = stb.replaceAll(key, "");
} while (true);
...
StringunescapeHTMLEntities(String source)
unescape HTML Entities
Iterator<String> it = htmlEntities.keySet().iterator();
while (it.hasNext()) {
    String key = it.next();
    String val = htmlEntities.get(key);
    source = source.replaceAll(key, val);
return source;