Example usage for org.apache.commons.lang3.text.translate EntityArrays HTML40_EXTENDED_UNESCAPE

List of usage examples for org.apache.commons.lang3.text.translate EntityArrays HTML40_EXTENDED_UNESCAPE

Introduction

In this page you can find the example usage for org.apache.commons.lang3.text.translate EntityArrays HTML40_EXTENDED_UNESCAPE.

Prototype

String[][] HTML40_EXTENDED_UNESCAPE

To view the source code for org.apache.commons.lang3.text.translate EntityArrays HTML40_EXTENDED_UNESCAPE.

Click Source Link

Usage

From source file:cc.clabs.stratosphere.mlp.utils.StringUtils.java

/**
 * Unescapes special entity char sequences like < to its UTF-8 representation.
 * All ISO-8859-1, HTML4 and Basic entities will be translated.
 * /*w  w w.ja va2s.  co  m*/
 * @param text the text that will be unescaped
 * @return the unescaped version of the string text
 */
public static String unescapeEntities(String text) {
    CharSequenceTranslator iso = new LookupTranslator(EntityArrays.ISO8859_1_UNESCAPE());
    CharSequenceTranslator basic = new LookupTranslator(EntityArrays.BASIC_UNESCAPE());
    CharSequenceTranslator html4 = new LookupTranslator(EntityArrays.HTML40_EXTENDED_UNESCAPE());
    return html4.translate(iso.translate(basic.translate(text)));
}