| Modifier and Type | Class and Description |
|---|---|
static class |
SaslPrep.StringType
The type of string usage regarding the support for unassigned code points as described in RFC
3454, Section 7.
|
| Constructor and Description |
|---|
SaslPrep() |
| Modifier and Type | Method and Description |
|---|---|
private static boolean |
isAsciiControlCharacter(char chr)
Prohibited Output: ASCII control characters [StringPrep, C.2.1].
|
private static boolean |
isBidiLCat(int cp)
Bidirectional Characters: LCat characters.
|
private static boolean |
isBidiRAndAlCat(int cp)
Bidirectional Characters: RandALCat characters.
|
private static boolean |
isChangeDisplayPropertiesOrDeprecatedCharacter(char chr)
Prohibited Output: change display properties or deprecated characters [StringPrep, C.8].
|
private static boolean |
isInappropriateForCanonicalRepresentationCharacter(char chr)
Prohibited Output: inappropriate for canonical representation characters [StringPrep,
C.7].
|
private static boolean |
isInappropriateForPlainTextCharacter(char chr)
Prohibited Output: inappropriate for plain text characters [StringPrep, C.6].
|
private static boolean |
isMappeableToNothing(char chr)
Mapping: the "commonly mapped to nothing" characters [StringPrep, B.1] that can be mapped
to nothing.
|
private static boolean |
isNonAsciiControlCharacter(int cp)
Prohibited Output: non-ASCII control characters [StringPrep, C.2.2].
|
private static boolean |
isNonAsciiSpaceChar(char chr)
Mapping: non-ASCII space characters [StringPrep, C.1.2] that can be mapped to SPACE
(U+0020).
|
private static boolean |
isNonCharacterCodePoint(int cp)
Prohibited Output: non-character code points [StringPrep, C.4].
|
private static boolean |
isPrivateUseCharacter(int cp)
Prohibited Output: private use characters [StringPrep, C.3].
|
private static boolean |
isProhibited(char chr,
int cp)
Checks if the given character is one of the prohibited characters under the "SASLprep Profile" rules.
|
private static boolean |
isSurrogateCode(char chr)
Prohibited Output: surrogate code points [StringPrep, C.5].
|
private static boolean |
isTaggingCharacter(int cp)
Prohibited Output: tagging characters [StringPrep, C.9].
|
private static boolean |
isUnassigned(int cp)
Unassigned Code Points: list of unassigned code points.
|
private static String |
normalizeKc(CharSequence str)
Normalization: Unicode normalization form KC.
|
static String |
prepare(String str,
SaslPrep.StringType sType)
Prepares the given string by applying the "SASLprep" profile of the "stringprep" algorithm.
|
public static String prepare(String str, SaslPrep.StringType sType)
private static boolean isNonAsciiSpaceChar(char chr)
chr - the character to check.true if the character is one of the non-ASCII space characters, false otherwise.private static boolean isMappeableToNothing(char chr)
chr - the character to check.true if the character is one of the "commonly mapped to nothing" characters, false otherwise.private static String normalizeKc(CharSequence str)
str - the string to be normalized.private static boolean isProhibited(char chr,
int cp)
chr - the character to check.cp - the code point of the character to check.true if the character is prohibited according to the profile rules, false otherwise.private static boolean isAsciiControlCharacter(char chr)
chr - the character to check.true if the character is one of the ASCII control characters, false otherwise.private static boolean isNonAsciiControlCharacter(int cp)
cp - the code point of the character to check.true if the character is one of the non-ASCII control characters, false otherwise.private static boolean isPrivateUseCharacter(int cp)
cp - the code point of the character to check.true if the character is one of the private use characters, false otherwise.private static boolean isNonCharacterCodePoint(int cp)
cp - the code point of the character to check.true if the character is one of the non-character code points, false otherwise.private static boolean isSurrogateCode(char chr)
chr - the character to check.true if the character is one of the surrogate code points, false otherwise.private static boolean isInappropriateForPlainTextCharacter(char chr)
chr - the character to check.true if the character is one of the inappropriate for plain text characters, false otherwise.private static boolean isInappropriateForCanonicalRepresentationCharacter(char chr)
chr - the character to check.true if the character is one of the inappropriate for canonical representation characters, false otherwise.private static boolean isChangeDisplayPropertiesOrDeprecatedCharacter(char chr)
chr - the character to check.true if the character is one of the change display properties or deprecated characters, false otherwise.private static boolean isTaggingCharacter(int cp)
cp - the code point of the character to check.true if the character is one of the tagging characters, false otherwise.private static boolean isBidiRAndAlCat(int cp)
cp - the code point of the character to check.true if the character is one of the RandALCat characters, false otherwise.private static boolean isBidiLCat(int cp)
cp - the code point of the character to check.true if the character is one of the LCat characters, false otherwise.private static boolean isUnassigned(int cp)
Note that this implementation does not check exactly the unassigned code points as specified in the RFC since it is based on Java's Unicode support, which is updated regularly while the specification is based on a static list of code points. This should have no major impact, though.
cp - the code point of the character to check.true if the character is unassigned, false otherwise.