Top Description Fields Constructors Methods
org.apache.commons.lang3.text.translate

public Class UnicodeEscaper

extends CodePointTranslator
Class Inheritance
Known Direct Subclasses
org.apache.commons.lang3.text.translate.JavaUnicodeEscaper
Annotations
@Deprecated
Imports
java.io.IOException, .Writer

Deprecated

As of 3.6, use Apache Commons Text UnicodeEscaper.

Translates code points to their Unicode escaped value.
Since
3.0

Field Summary

Modifier and TypeField and Description
private final int
private final int
private final boolean

Constructor Summary

AccessConstructor and Description
public
UnicodeEscaper()

Constructs a UnicodeEscaper for all characters.

protected
UnicodeEscaper(final int
int value representing the lowest code point boundary.
below
,
final int
int value representing the highest code point boundary.
above
,
final boolean
whether to escape between the boundaries or outside them.
between
)

Constructs a UnicodeEscaper for the specified range.

Method Summary

Modifier and TypeMethod and Description
public static UnicodeEscaper

Returns:

the newly created UnicodeEscaper instance.
above
(final int
above which to escape.
codePoint
)
References Deprecated UnicodeEscaper is deprecated or references (maybe indirectly) at least one deprecated element.

Constructs a UnicodeEscaper above the specified value (exclusive).

public static UnicodeEscaper

Returns:

the newly created UnicodeEscaper instance.
below
(final int
below which to escape.
codePoint
)
References Deprecated UnicodeEscaper is deprecated or references (maybe indirectly) at least one deprecated element.

Constructs a UnicodeEscaper below the specified value (exclusive).

public static UnicodeEscaper

Returns:

the newly created UnicodeEscaper instance.
between
(final int
above which to escape.
codePointLow
,
final int
below which to escape.
codePointHigh
)
References Deprecated UnicodeEscaper is deprecated or references (maybe indirectly) at least one deprecated element.

Constructs a UnicodeEscaper between the specified values (inclusive).

public static UnicodeEscaper

Returns:

the newly created UnicodeEscaper instance.
outsideOf
(final int
below which to escape.
codePointLow
,
final int
above which to escape.
codePointHigh
)
References Deprecated UnicodeEscaper is deprecated or references (maybe indirectly) at least one deprecated element.

Constructs a UnicodeEscaper outside of the specified values (exclusive).

protected String

Returns:

the hexadecimal string for the given code point.
toUtf16Escape
(final int
a Unicode code point.
codePoint
)

Converts the given code point to a hexadecimal string of the form "\\uXXXX"

public boolean
translate(final int codePoint, final Writer out)

Implements abstract org.apache.commons.lang3.text.translate.CodePointTranslator.translate.

Translate the specified code point into another.

Inherited from org.apache.commons.lang3.text.translate.CodePointTranslator:
translate

Field Detail

aboveback to summary
private final int above
belowback to summary
private final int below
betweenback to summary
private final boolean between

Constructor Detail

UnicodeEscaperback to summary
public UnicodeEscaper()

Constructs a UnicodeEscaper for all characters.

UnicodeEscaperback to summary
protected UnicodeEscaper(final int below, final int above, final boolean between)

Constructs a UnicodeEscaper for the specified range. This is the underlying method for the other constructors/builders. The below and above boundaries are inclusive when between is true and exclusive when it is false.

Parameters
below:int

int value representing the lowest code point boundary.

above:int

int value representing the highest code point boundary.

between:boolean

whether to escape between the boundaries or outside them.

Method Detail

aboveback to summary
public static UnicodeEscaper above(final int codePoint)

References Deprecated

UnicodeEscaper is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructs a UnicodeEscaper above the specified value (exclusive).

Parameters
codePoint:int

above which to escape.

Returns:UnicodeEscaper

the newly created UnicodeEscaper instance.

belowback to summary
public static UnicodeEscaper below(final int codePoint)

References Deprecated

UnicodeEscaper is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructs a UnicodeEscaper below the specified value (exclusive).

Parameters
codePoint:int

below which to escape.

Returns:UnicodeEscaper

the newly created UnicodeEscaper instance.

betweenback to summary
public static UnicodeEscaper between(final int codePointLow, final int codePointHigh)

References Deprecated

UnicodeEscaper is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructs a UnicodeEscaper between the specified values (inclusive).

Parameters
codePointLow:int

above which to escape.

codePointHigh:int

below which to escape.

Returns:UnicodeEscaper

the newly created UnicodeEscaper instance.

outsideOfback to summary
public static UnicodeEscaper outsideOf(final int codePointLow, final int codePointHigh)

References Deprecated

UnicodeEscaper is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Constructs a UnicodeEscaper outside of the specified values (exclusive).

Parameters
codePointLow:int

below which to escape.

codePointHigh:int

above which to escape.

Returns:UnicodeEscaper

the newly created UnicodeEscaper instance.

toUtf16Escapeback to summary
protected String toUtf16Escape(final int codePoint)

Converts the given code point to a hexadecimal string of the form "\\uXXXX"

Parameters
codePoint:int

a Unicode code point.

Returns:String

the hexadecimal string for the given code point.

Since
3.2
translateback to summary
public boolean translate(final int codePoint, final Writer out) throws IOException

Implements abstract org.apache.commons.lang3.text.translate.CodePointTranslator.translate.

Doc from org.apache.commons.lang3.text.translate.CodePointTranslator.translate.

Translate the specified code point into another.

Annotations
@Override
Exceptions
IOException:
if and only if the Writer produces an IOException.