Java org.apache.commons.lang3 StringEscapeUtils fields, constructors, methods, implement or subclass

Example usage for Java org.apache.commons.lang3 StringEscapeUtils fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.apache.commons.lang3 StringEscapeUtils.

The text is from its open source code.

Subclass

org.apache.commons.lang3.StringEscapeUtils has subclasses.
Click this link to see all its subclasses.

Field

CharSequenceTranslatorESCAPE_JAVA
Translator object for escaping Java.
CharSequenceTranslatorESCAPE_ECMASCRIPT
Translator object for escaping EcmaScript/JavaScript.
CharSequenceTranslatorESCAPE_JSON
Translator object for escaping Json.
CharSequenceTranslatorESCAPE_XML10
Translator object for escaping XML 1.0.
CharSequenceTranslatorESCAPE_HTML3
Translator object for escaping HTML version 3.0.
CharSequenceTranslatorESCAPE_HTML4
Translator object for escaping HTML version 4.0.
CharSequenceTranslatorESCAPE_CSV
Translator object for escaping individual Comma Separated Values.
CharSequenceTranslatorUNESCAPE_JAVA
Translator object for unescaping escaped Java.
CharSequenceTranslatorUNESCAPE_JSON
Translator object for unescaping escaped Json.
CharSequenceTranslatorUNESCAPE_HTML3
Translator object for unescaping escaped HTML 3.0.
CharSequenceTranslatorUNESCAPE_HTML4
Translator object for unescaping escaped HTML 4.0.
CharSequenceTranslatorUNESCAPE_XML
Translator object for unescaping escaped XML.
CharSequenceTranslatorUNESCAPE_CSV
Translator object for unescaping escaped Comma Separated Value entries.

Constructor

StringEscapeUtils()

StringEscapeUtils instances should NOT be constructed in standard programming.

Instead, the class should be used as:

StringEscapeUtils.escapeJava("foo");

This constructor is public to permit tools that require a JavaBean instance to operate.

Method

StringescapeCsv(final String input)

Returns a String value for a CSV column enclosed in double quotes, if required.

If the value contains a comma, newline or double quote, then the String value is returned enclosed in double quotes.

Any double quote characters in the value are escaped with another double quote.

If the value does not contain a comma, newline or double quote, then the String value is returned unchanged.

see Wikipedia and RFC 4180.
StringescapeEcmaScript(final String input)

Escapes the characters in a String using EcmaScript String rules.

Escapes any values it finds into their EcmaScript String form.

StringescapeHtml3(final String input)

Escapes the characters in a String using HTML entities.

Supports only the HTML 3.0 entities.

StringescapeHtml4(final String input)

Escapes the characters in a String using HTML entities.

For example:

"bread" & "butter"

becomes:

"bread" & "butter".

StringescapeJava(final String input)

Escapes the characters in a String using Java String rules.

Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.)

So a tab becomes the characters '\\' and 't' .

The only difference between Java strings and JavaScript strings is that in JavaScript, a single quote and forward-slash (/) are escaped.

Example:

 input string: He didn't say, "Stop!" 
StringescapeJson(final String input)

Escapes the characters in a String using Json String rules.

Escapes any values it finds into their Json String form.

StringescapeXml(final String input)

Escapes the characters in a String using XML entities.

For example: "bread" & "butter" => "bread" & "butter" .

StringescapeXml10(final String input)

Escapes the characters in a String using XML entities.

For example: "bread" & "butter" => "bread" & "butter" .

StringescapeXml11(final String input)

Escapes the characters in a String using XML entities.

For example: "bread" & "butter" => "bread" & "butter" .

StringunescapeCsv(final String input)

Returns a String value for an unescaped CSV column.

StringunescapeEcmaScript(final String input)

Unescapes any EcmaScript literals found in the String .

For example, it will turn a sequence of '\' and 'n' into a newline character, unless the '\' is preceded by another '\' .

StringunescapeHtml3(final String input)

Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes.

StringunescapeHtml4(final String input)

Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes.

StringunescapeJava(final String input)

Unescapes any Java literals found in the String .

StringunescapeJson(final String input)

Unescapes any Json literals found in the String .

For example, it will turn a sequence of '\' and 'n' into a newline character, unless the '\' is preceded by another '\' .

StringunescapeXml(final String input)

Unescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes.

Supports only the five basic XML entities (gt, lt, quot, amp, apos).