RonsoftCharsetProviderpublic class RonsoftCharsetProvider extends CharsetProvider A CharsetProvider class which makes available the charsets
provided by Ronsoft. Currently there is only one, namely the X-ROT13
charset. This is not a registered IANA charset, so it's
name begins with "X-" to avoid name clashes with offical charsets.
To activate this CharsetProvider, it's necessary to add a file to
the classpath of the JVM runtime at the following location:
META-INF/services/java.nio.charsets.spi.CharsetProvider
That file must contain a line with the fully qualified name of
this class on a line by itself:
com.ronsoft.books.nio.charset.RonsoftCharsetProvider
See the javadoc page for java.nio.charsets.spi.CharsetProvider
for full details. |
Fields Summary |
---|
private static final String | CHARSET_NAME | private Charset | rot13 |
Constructors Summary |
---|
public RonsoftCharsetProvider()Constructor, instantiate a Charset object and save the reference.
this.rot13 = new Rot13Charset (CHARSET_NAME, new String [0]);
|
Methods Summary |
---|
public java.nio.charset.Charset | charsetForName(java.lang.String charsetName)Called by Charset static methods to find a particular named
Charset. If it's the name of this charset (we don't have
any aliases) then return the Rot13 Charset, else return null.
if (charsetName.equalsIgnoreCase (CHARSET_NAME)) {
return (rot13);
}
return (null);
| public java.util.Iterator | charsets()Return an Iterator over the set of Charset objects we provide.
HashSet set = new HashSet (1);
set.add (rot13);
return (set.iterator());
|
|