com.ibm.icu.charset
Class CharsetProviderICU

java.lang.Object
  extended by java.nio.charset.spi.CharsetProvider
      extended by com.ibm.icu.charset.CharsetProviderICU

public final class CharsetProviderICU
extends java.nio.charset.spi.CharsetProvider

A concrete subclass of CharsetProvider for loading and providing charset converters in ICU.

Status:
Stable ICU 3.6.

Constructor Summary
CharsetProviderICU()
          Default constructor
 
Method Summary
 java.nio.charset.Charset charsetForName(java.lang.String charsetName)
          Constructs a charset for the given charset name.
 java.nio.charset.Charset charsetForName(java.lang.String charsetName, java.lang.String classPath)
          Constructs a charset for the given ICU conversion table from the specified class path.
 java.nio.charset.Charset charsetForName(java.lang.String charsetName, java.lang.String classPath, java.lang.ClassLoader loader)
          Constructs a charset for the given ICU conversion table from the specified class path.
 java.util.Iterator<java.nio.charset.Charset> charsets()
          Returns an iterator for the available charsets.
static java.lang.String[] getAllNames()
          Deprecated. This API is ICU internal only.
static java.lang.String[] getAvailableNames()
          Deprecated. This API is ICU internal only.
static java.lang.String getICUCanonicalName(java.lang.String enc)
          Deprecated. This API is ICU internal only.
static java.lang.String getJavaCanonicalName(java.lang.String charsetName)
          Deprecated. This API is ICU internal only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharsetProviderICU

public CharsetProviderICU()
Default constructor

Status:
Stable ICU 3.6.
Method Detail

charsetForName

public final java.nio.charset.Charset charsetForName(java.lang.String charsetName)
Constructs a charset for the given charset name. Implements the abstract method of super class.

Specified by:
charsetForName in class java.nio.charset.spi.CharsetProvider
Parameters:
charsetName - charset name
Returns:
charset objet for the given charset name, null if unsupported
Status:
Stable ICU 3.6.

charsetForName

public final java.nio.charset.Charset charsetForName(java.lang.String charsetName,
                                                     java.lang.String classPath)
Constructs a charset for the given ICU conversion table from the specified class path. Example use: cnv = CharsetProviderICU.charsetForName("myConverter", "com/myCompany/myDataPackage");. In this example myConverter.cnv would exist in the com/myCompany/myDataPackage Java package. Conversion tables can be made with ICU4C's makeconv tool. This function allows you to allows you to load user defined conversion tables that are outside of ICU's core data.

Parameters:
charsetName - The name of the charset conversion table.
classPath - The class path that contain the conversion table.
Returns:
charset object for the given charset name, null if unsupported
Status:
Stable ICU 3.8.

charsetForName

public java.nio.charset.Charset charsetForName(java.lang.String charsetName,
                                               java.lang.String classPath,
                                               java.lang.ClassLoader loader)
Constructs a charset for the given ICU conversion table from the specified class path. This function is similar to charsetForName(String, String).

Parameters:
charsetName - The name of the charset conversion table.
classPath - The class path that contain the conversion table.
loader - the class object from which to load the charset conversion table
Returns:
charset object for the given charset name, null if unsupported
Status:
Stable ICU 3.8.

getICUCanonicalName

public static final java.lang.String getICUCanonicalName(java.lang.String enc)
                                                  throws java.nio.charset.UnsupportedCharsetException
Deprecated. This API is ICU internal only.

Gets the canonical name of the converter as defined by Java

Parameters:
enc - converter name
Returns:
canonical name of the converter
Throws:
java.nio.charset.UnsupportedCharsetException
Status:
Internal. This API is ICU internal only.

getJavaCanonicalName

public static java.lang.String getJavaCanonicalName(java.lang.String charsetName)
Deprecated. This API is ICU internal only.

Gets the canonical name of the converter as defined by Java

Parameters:
charsetName - converter name
Returns:
canonical name of the converter
Status:
Internal. This API is ICU internal only.

charsets

public final java.util.Iterator<java.nio.charset.Charset> charsets()
Returns an iterator for the available charsets. Implements the abstract method of super class.

Specified by:
charsets in class java.nio.charset.spi.CharsetProvider
Returns:
Iterator the charset name iterator
Status:
Stable ICU 3.6.

getAvailableNames

public static final java.lang.String[] getAvailableNames()
Deprecated. This API is ICU internal only.

Gets the canonical names of available converters

Returns:
array of available converter names
Status:
Internal. This API is ICU internal only.

getAllNames

public static final java.lang.String[] getAllNames()
Deprecated. This API is ICU internal only.

Return all names available

Returns:
String[] an array of all available names
Status:
Internal. This API is ICU internal only.


Copyright (c) 2011 IBM Corporation and others.