Class UnicodeEscaper
java.lang.Object
org.apache.commons.lang3.text.translate.CharSequenceTranslator
org.apache.commons.lang3.text.translate.CodePointTranslator
org.apache.commons.lang3.text.translate.UnicodeEscaper
- Direct Known Subclasses:
JavaUnicodeEscaper
Deprecated.
as of 3.6, use commons-text
UnicodeEscaper instead
Translates codepoints to their Unicode escaped value.
- Since:
- 3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intDeprecated.private final intDeprecated.private final booleanDeprecated.Fields inherited from class org.apache.commons.lang3.text.translate.CharSequenceTranslator
HEX_DIGITS -
Constructor Summary
ConstructorsModifierConstructorDescriptionDeprecated.Constructs aUnicodeEscaperfor all characters.protectedUnicodeEscaper(int below, int above, boolean between) Deprecated.Constructs aUnicodeEscaperfor the specified range. -
Method Summary
Modifier and TypeMethodDescriptionstatic UnicodeEscaperabove(int codepoint) Deprecated.Constructs aUnicodeEscaperabove the specified value (exclusive).static UnicodeEscaperbelow(int codepoint) Deprecated.Constructs aUnicodeEscaperbelow the specified value (exclusive).static UnicodeEscaperbetween(int codepointLow, int codepointHigh) Deprecated.Constructs aUnicodeEscaperbetween the specified values (inclusive).static UnicodeEscaperoutsideOf(int codepointLow, int codepointHigh) Deprecated.Constructs aUnicodeEscaperoutside of the specified values (exclusive).protected StringtoUtf16Escape(int codepoint) Deprecated.Converts the given codepoint to a hex string of the form"\\uXXXX"booleanDeprecated.Translate the specified codepoint into another.Methods inherited from class org.apache.commons.lang3.text.translate.CodePointTranslator
translateMethods inherited from class org.apache.commons.lang3.text.translate.CharSequenceTranslator
hex, translate, translate, with
-
Field Details
-
below
private final int belowDeprecated. -
above
private final int aboveDeprecated. -
between
private final boolean betweenDeprecated.
-
-
Constructor Details
-
UnicodeEscaper
public UnicodeEscaper()Deprecated.Constructs a
UnicodeEscaperfor all characters. -
UnicodeEscaper
protected UnicodeEscaper(int below, int above, boolean between) Deprecated.Constructs a
UnicodeEscaperfor the specified range. This is the underlying method for the other constructors/builders. Thebelowandaboveboundaries are inclusive whenbetweenistrueand exclusive when it isfalse.- Parameters:
below- int value representing the lowest codepoint boundaryabove- int value representing the highest codepoint boundarybetween- whether to escape between the boundaries or outside them
-
-
Method Details
-
below
Deprecated.Constructs a
UnicodeEscaperbelow the specified value (exclusive).- Parameters:
codepoint- below which to escape- Returns:
- the newly created
UnicodeEscaperinstance
-
above
Deprecated.Constructs a
UnicodeEscaperabove the specified value (exclusive).- Parameters:
codepoint- above which to escape- Returns:
- the newly created
UnicodeEscaperinstance
-
outsideOf
Deprecated.Constructs a
UnicodeEscaperoutside of the specified values (exclusive).- Parameters:
codepointLow- below which to escapecodepointHigh- above which to escape- Returns:
- the newly created
UnicodeEscaperinstance
-
between
Deprecated.Constructs a
UnicodeEscaperbetween the specified values (inclusive).- Parameters:
codepointLow- above which to escapecodepointHigh- below which to escape- Returns:
- the newly created
UnicodeEscaperinstance
-
translate
Deprecated.Translate the specified codepoint into another.- Specified by:
translatein classCodePointTranslator- Parameters:
codepoint- int character input to translateout- Writer to optionally push the translated output to- Returns:
- boolean as to whether translation occurred or not
- Throws:
IOException- if and only if the Writer produces an IOException
-
toUtf16Escape
Deprecated.Converts the given codepoint to a hex string of the form"\\uXXXX"- Parameters:
codepoint- a Unicode code point- Returns:
- the hex string for the given codepoint
- Since:
- 3.2
-