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

public Class NumericEntityEscaper

extends CodePointTranslator
Class Inheritance
Imports
java.io.IOException, .Writer, org.apache.commons.lang3.Range

Translates code points to their XML numeric entity escaped value.
Since
1.0

Field Summary

Modifier and TypeField and Description
private final boolean
between

Whether to escape between the boundaries or outside them.

private final Range<Integer>
range

Range from lowest code point to highest code point.

Constructor Summary

AccessConstructor and Description
public
NumericEntityEscaper()

Constructs a NumericEntityEscaper for all characters.

private
NumericEntityEscaper(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 NumericEntityEscaper for the specified range.

Method Summary

Modifier and TypeMethod and Description
public static NumericEntityEscaper

Returns:

The newly created NumericEntityEscaper instance.
above
(final int
above which to escape.
codePoint
)

Constructs a NumericEntityEscaper above the specified value (exclusive).

public static NumericEntityEscaper

Returns:

The newly created NumericEntityEscaper instance.
below
(final int
below which to escape.
codePoint
)

Constructs a NumericEntityEscaper below the specified value (exclusive).

public static NumericEntityEscaper

Returns:

The newly created NumericEntityEscaper instance.
between
(final int
above which to escape.
codePointLow
,
final int
below which to escape.
codePointHigh
)

Constructs a NumericEntityEscaper between the specified values (inclusive).

public static NumericEntityEscaper

Returns:

The newly created NumericEntityEscaper instance.
outsideOf
(final int
below which to escape.
codePointLow
,
final int
above which to escape.
codePointHigh
)

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

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

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

Translates the specified code point into another.

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

Field Detail

betweenback to summary
private final boolean between

Whether to escape between the boundaries or outside them.

rangeback to summary
private final Range<Integer> range

Range from lowest code point to highest code point.

Constructor Detail

NumericEntityEscaperback to summary
public NumericEntityEscaper()

Constructs a NumericEntityEscaper for all characters.

NumericEntityEscaperback to summary
private NumericEntityEscaper(final int below, final int above, final boolean between)

Constructs a NumericEntityEscaper 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 NumericEntityEscaper above(final int codePoint)

Constructs a NumericEntityEscaper above the specified value (exclusive).

Parameters
codePoint:int

above which to escape.

Returns:NumericEntityEscaper

The newly created NumericEntityEscaper instance.

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

Constructs a NumericEntityEscaper below the specified value (exclusive).

Parameters
codePoint:int

below which to escape.

Returns:NumericEntityEscaper

The newly created NumericEntityEscaper instance.

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

Constructs a NumericEntityEscaper between the specified values (inclusive).

Parameters
codePointLow:int

above which to escape.

codePointHigh:int

below which to escape.

Returns:NumericEntityEscaper

The newly created NumericEntityEscaper instance.

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

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

Parameters
codePointLow:int

below which to escape.

codePointHigh:int

above which to escape.

Returns:NumericEntityEscaper

The newly created NumericEntityEscaper instance.

translateback to summary
public boolean translate(final int codePoint, final Writer writer) throws IOException

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

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

Translates the specified code point into another.

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