FileDocCategorySizeDatePackage
RonsoftCharsetProvider.javaAPI DocExample2135Mon May 20 00:24:30 BST 2002com.ronsoft.books.nio.charset

RonsoftCharsetProvider

public 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.
author
Ron Hitchens (ron@ronsoft.com)
version
$Id: RonsoftCharsetProvider.java,v 1.6 2002/05/20 07:24:31 ron Exp $ Created: January, 2002

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.CharsetcharsetForName(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.Iteratorcharsets()
Return an Iterator over the set of Charset objects we provide.

return
An Iterator object containing references to all the Charset objects provided by this class.

		HashSet set = new HashSet (1);

		set.add (rot13);

		return (set.iterator());