org.apache.wookie.w3c.util
Class UnicodeUtils

java.lang.Object
  extended by org.apache.wookie.w3c.util.UnicodeUtils

public class UnicodeUtils
extends java.lang.Object

A utility class for sanitizing unicode strings in accordance with the rules for handling normalized text content and attributes set out in the W3C Widgets specification


Constructor Summary
UnicodeUtils()
           
 
Method Summary
static java.lang.String normalizeSpaces(java.lang.String in)
          Normalizes all space characters in the given string to U+0020, then collapses multiple adjacent spaces to a single space, and removes any leading and trailing spaces.
static java.lang.String normalizeWhitespace(java.lang.String in)
          Normalizes all whitespace and space characters in the given string to U+0020, then collapses multiple adjacent spaces to a single space, and removes any leading and trailing spaces.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnicodeUtils

public UnicodeUtils()
Method Detail

normalizeWhitespace

public static java.lang.String normalizeWhitespace(java.lang.String in)
Normalizes all whitespace and space characters in the given string to U+0020, then collapses multiple adjacent spaces to a single space, and removes any leading and trailing spaces. If the input string is null, the method returns an empty string ("")

Parameters:
in - the string to normalize
Returns:
the normalized string

normalizeSpaces

public static java.lang.String normalizeSpaces(java.lang.String in)
Normalizes all space characters in the given string to U+0020, then collapses multiple adjacent spaces to a single space, and removes any leading and trailing spaces. If the input string is null, the method returns an empty string ("")

Parameters:
in - the string to normalize
Returns:
the normalized string


2012 Apache Software Foundation.