org.enhydra.xml.io
Class Encodings

java.lang.Object
  |
  +--org.enhydra.xml.io.Encodings

public final class Encodings
extends Object

Class that manages information about encodings.


Field Summary
static String ISO_8859_1
          Some standard character set constants.
static String SHIFT_JIS
           
static String US_ASCII
           
 
Method Summary
 String[] getAliases(String encoding)
          Get the encoding aliases, given any encoding or alias, or null if unknown encoding.
 CharacterSet getCharacterSet(String encoding)
          Get the entry for an encoding name or null.
static Encodings getEncodings()
          Get the singleton instance of this class.
 int getMaxCharacterValue(String encoding)
          Get the maximum value of an unicode character in an encoding.
 String getMIMEPreferred(String encoding)
          Get the preferred MIME encoding, or null if unknown encoding.
 String getName(String encoding)
          Get the encoding name, given any encoding or alias, or null if unknown encoding.
 boolean isValid(String encoding)
          Determine if an encoding is a valid encoding.
 boolean sameEncodings(String encoding1, String encoding2)
          Determine if two encoding names represent the same encoding.
 String toString()
          Return string representation for debugging.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ISO_8859_1

public static final String ISO_8859_1
Some standard character set constants. Using the standard names.

US_ASCII

public static final String US_ASCII

SHIFT_JIS

public static final String SHIFT_JIS
Method Detail

getCharacterSet

public CharacterSet getCharacterSet(String encoding)
Get the entry for an encoding name or null.

isValid

public boolean isValid(String encoding)
Determine if an encoding is a valid encoding.

getName

public String getName(String encoding)
Get the encoding name, given any encoding or alias, or null if unknown encoding.

getMIMEPreferred

public String getMIMEPreferred(String encoding)
Get the preferred MIME encoding, or null if unknown encoding.

getAliases

public String[] getAliases(String encoding)
Get the encoding aliases, given any encoding or alias, or null if unknown encoding.

getMaxCharacterValue

public int getMaxCharacterValue(String encoding)
Get the maximum value of an unicode character in an encoding. This checks for 7 and 8 bit encodings; everything else is considered to require 16 bits.

sameEncodings

public boolean sameEncodings(String encoding1,
                             String encoding2)
Determine if two encoding names represent the same encoding. Handles nulls, with two nulls being considered the same encoding.

toString

public String toString()
Return string representation for debugging.
Overrides:
toString in class Object

getEncodings

public static Encodings getEncodings()
Get the singleton instance of this class.


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.