Top Description Constructors Methods
com.sun.msv.datatype.xsd

public Class UnicodeUtil

extends Object
Class Inheritance

Unicode-related utility functions.
Author
Kohsuke KAWAGUCHI

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static int
countLength(String str)

Count the number of "character" in Unicode string.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnicodeUtilback to summary
public UnicodeUtil()

Method Detail

countLengthback to summary
public static int countLength(String str)

Count the number of "character" in Unicode string. "character" here is defined by http://www.w3.org/TR/REC-xml#NT-Char Basically, all the work this function will do is to take care of surrogate pairs. If string contains any char ('char' in Java datatype) other than those allowed in XML spec, the behavior is undefined. However, we can safely assume that XML parser performs this check before we receive the value.