public class JavaUnicodeEscaper extends UnicodeEscaper
Constructor and Description |
---|
JavaUnicodeEscaper(int below,
int above,
boolean between)
Constructs a
JavaUnicodeEscaper for the specified range. |
Modifier and Type | Method and Description |
---|---|
static JavaUnicodeEscaper |
above(int codepoint)
Constructs a
JavaUnicodeEscaper above the specified value (exclusive). |
static JavaUnicodeEscaper |
below(int codepoint)
Constructs a
JavaUnicodeEscaper below the specified value (exclusive). |
static JavaUnicodeEscaper |
between(int codepointLow,
int codepointHigh)
Constructs a
JavaUnicodeEscaper between the specified values (inclusive). |
static JavaUnicodeEscaper |
outsideOf(int codepointLow,
int codepointHigh)
Constructs a
JavaUnicodeEscaper outside of the specified values (exclusive). |
protected String |
toUtf16Escape(int codepoint)
Converts the given codepoint to a hex string of the form
"\\uXXXX\\uXXXX" |
translate
translate
hex, translate, translate, with
public JavaUnicodeEscaper(int below, int above, boolean between)
Constructs a JavaUnicodeEscaper
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
.
below
- int value representing the lowest codepoint boundaryabove
- int value representing the highest codepoint boundarybetween
- whether to escape between the boundaries or outside thempublic static JavaUnicodeEscaper above(int codepoint)
Constructs a JavaUnicodeEscaper
above the specified value (exclusive).
codepoint
- above which to escapeUnicodeEscaper
instancepublic static JavaUnicodeEscaper below(int codepoint)
Constructs a JavaUnicodeEscaper
below the specified value (exclusive).
codepoint
- below which to escapeUnicodeEscaper
instancepublic static JavaUnicodeEscaper between(int codepointLow, int codepointHigh)
Constructs a JavaUnicodeEscaper
between the specified values (inclusive).
codepointLow
- above which to escapecodepointHigh
- below which to escapeUnicodeEscaper
instancepublic static JavaUnicodeEscaper outsideOf(int codepointLow, int codepointHigh)
Constructs a JavaUnicodeEscaper
outside of the specified values (exclusive).
codepointLow
- below which to escapecodepointHigh
- above which to escapeUnicodeEscaper
instanceprotected String toUtf16Escape(int codepoint)
"\\uXXXX\\uXXXX"
toUtf16Escape
in class UnicodeEscaper
codepoint
- a Unicode code pointCopyright © 2001–2015 The Apache Software Foundation. All rights reserved.