Class TextNormalizationHelper
java.lang.Object
com.perforce.p4java.impl.mapbased.rpc.sys.helper.TextNormalizationHelper
This helper class dynamically loads the "java.text.Normalizer" in JDK 6 or
above using reflection. It provides the method normalize which transforms
Unicode text into an equivalent composed or decomposed form. The normalize
method supports the standard normalization forms described in Unicode
Standard Annex #15 — Unicode Normalization Forms.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if is normalization capable.static booleanisNormalized(String text) Tests whether the text is normalized.static StringNormalizes the text.
-
Field Details
-
NORMALIZER_CLASS_NAME
- See Also:
-
NORMALIZER_FORM_CLASS_NAME
- See Also:
-
NORMALIZER_NORMALIZE_METHOD_NAME
- See Also:
-
NORMALIZER_IS_NORMALIZED_METHOD_NAME
- See Also:
-
-
Constructor Details
-
TextNormalizationHelper
public TextNormalizationHelper()
-
-
Method Details
-
isNormalizationCapable
public static boolean isNormalizationCapable()Checks if is normalization capable.- Returns:
- true, if is normalization capable
-
isNormalized
Tests whether the text is normalized.- Parameters:
text- the text to be checked for normalization- Returns:
- true if the text is normalized; false otherwise.
-
normalize
Normalizes the text.- Parameters:
text- the text to be normalized- Returns:
- string the normalized text
-