This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


java.nio.charset.spi
class CharsetProvider

java.lang.Object extended by java.nio.charset.spi.CharsetProvider

public abstract class CharsetProvider
extends Object

Charset service-provider class.

A charset provider is a concrete subclass of this class that has a zero-argument constructor and some number of associated charset implementation classes. Charset providers may be installed in an instance of the Java platform as extensions, that is, jar files placed into any of the usual extension directories. Providers may also be made available by adding them to the applet or application class path or by some other platform-specific means. Charset providers are looked up via the current thread's {@link java.lang.Thread#getContextClassLoader() context class loader}.

A charset provider identifies itself with a provider-configuration file named java.nio.charset.spi.CharsetProvider in the resource directory META-INF/services. The file should contain a list of fully-qualified concrete charset-provider class names, one per line. A line is terminated by any one of a line feed ('\n'), a carriage return ('\r'), or a carriage return followed immediately by a line feed. Space and tab characters surrounding each name, as well as blank lines, are ignored. The comment character is '#' ('\u0023'); on each line all characters following the first comment character are ignored. The file must be encoded in UTF-8.

If a particular concrete charset provider class is named in more than one configuration file, or is named in the same configuration file more than once, then the duplicates will be ignored. The configuration file naming a particular provider need not be in the same jar file or other distribution unit as the provider itself. The provider must be accessible from the same class loader that was initially queried to locate the configuration file; this is not necessarily the class loader that loaded the file.


Constructor Summary
protected
          Initializes a new charset provider.
 
Method Summary
abstract Charset
charsetForName(String charsetName)

          Retrieves a charset for the given charset name.
abstract Iterator
          Creates an iterator that iterates over the charsets supported by this provider.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharsetProvider

protected CharsetProvider()
Initializes a new charset provider.

Method Detail

charsetForName

public abstract Charset charsetForName(String charsetName)
Retrieves a charset for the given charset name.

Parameters:
charsetName - The name of the requested charset; may be either a canonical name or an alias
Returns:
A charset object for the named charset, or null if the named charset is not supported by this provider

charsets

public abstract Iterator charsets()
Creates an iterator that iterates over the charsets supported by this provider. This method is used in the implementation of the {@link java.nio.charset.Charset#availableCharsets Charset.availableCharsets} method.

Returns:
The new iterator


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.