Class TextNormalizationHelper
- java.lang.Object
-
- com.perforce.p4java.impl.mapbased.rpc.sys.helper.TextNormalizationHelper
-
public class TextNormalizationHelper extends java.lang.ObjectThis 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 Modifier and Type Field Description static java.lang.StringNORMALIZER_CLASS_NAMEstatic java.lang.StringNORMALIZER_FORM_CLASS_NAMEstatic java.lang.StringNORMALIZER_IS_NORMALIZED_METHOD_NAMEstatic java.lang.StringNORMALIZER_NORMALIZE_METHOD_NAME
-
Constructor Summary
Constructors Constructor Description TextNormalizationHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisNormalizationCapable()Checks if is normalization capable.static booleanisNormalized(java.lang.String text)Tests whether the text is normalized.static java.lang.Stringnormalize(java.lang.String text)Normalizes the text.
-
-
-
Field Detail
-
NORMALIZER_CLASS_NAME
public static final java.lang.String NORMALIZER_CLASS_NAME
- See Also:
- Constant Field Values
-
NORMALIZER_FORM_CLASS_NAME
public static final java.lang.String NORMALIZER_FORM_CLASS_NAME
- See Also:
- Constant Field Values
-
NORMALIZER_NORMALIZE_METHOD_NAME
public static final java.lang.String NORMALIZER_NORMALIZE_METHOD_NAME
- See Also:
- Constant Field Values
-
NORMALIZER_IS_NORMALIZED_METHOD_NAME
public static final java.lang.String NORMALIZER_IS_NORMALIZED_METHOD_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
isNormalizationCapable
public static boolean isNormalizationCapable()
Checks if is normalization capable.- Returns:
- true, if is normalization capable
-
isNormalized
public static boolean isNormalized(java.lang.String text)
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
public static java.lang.String normalize(java.lang.String text)
Normalizes the text.- Parameters:
text- the text to be normalized- Returns:
- string the normalized text
-
-