com.perforce.p4java.impl.mapbased.rpc.sys.helper
Class TextNormalizationHelper

java.lang.Object
  extended by com.perforce.p4java.impl.mapbased.rpc.sys.helper.TextNormalizationHelper

public class TextNormalizationHelper
extends Object

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
static String NORMALIZER_CLASS_NAME
           
static String NORMALIZER_FORM_CLASS_NAME
           
static String NORMALIZER_IS_NORMALIZED_METHOD_NAME
           
static String NORMALIZER_NORMALIZE_METHOD_NAME
           
 
Constructor Summary
TextNormalizationHelper()
           
 
Method Summary
static boolean isNormalizationCapable()
          Checks if is normalization capable.
static boolean isNormalized(String text)
          Tests whether the text is normalized.
static String normalize(String text)
          Normalizes the text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMALIZER_CLASS_NAME

public static final String NORMALIZER_CLASS_NAME
See Also:
Constant Field Values

NORMALIZER_FORM_CLASS_NAME

public static final String NORMALIZER_FORM_CLASS_NAME
See Also:
Constant Field Values

NORMALIZER_NORMALIZE_METHOD_NAME

public static final String NORMALIZER_NORMALIZE_METHOD_NAME
See Also:
Constant Field Values

NORMALIZER_IS_NORMALIZED_METHOD_NAME

public static final String NORMALIZER_IS_NORMALIZED_METHOD_NAME
See Also:
Constant Field Values
Constructor Detail

TextNormalizationHelper

public TextNormalizationHelper()
Method Detail

isNormalizationCapable

public static boolean isNormalizationCapable()
Checks if is normalization capable.

Returns:
true, if is normalization capable

isNormalized

public static boolean isNormalized(String text)
Tests whether the text is normalized.

Parameters:
string - the text to be checked for normalization
Returns:
true if the text is normalized; false otherwise.

normalize

public static String normalize(String text)
Normalizes the text.

Parameters:
string - the text to be normalized
Returns:
string the normalized text


Copyright © 2015 Perforce Software. All Rights Reserved.