Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weblogic.apache.xalan.serialize
Class Encodings

    java.lang.Object
      |
      +--weblogic.apache.xalan.serialize.Encodings

public class Encodings
extends java.lang.Object

Provides information about encodings. Depends on the Java runtime to provides writers for the different encodings, but can be used to override encoding names and provide the last printable character for each encoding.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.

Version:
  $Revision: 1.8 $ $Date: 2001/11/04 05:22:27 $
Author:
  Assaf Arkin

Field Summary
`static java.lang.String` | `DEFAULT_MIME_ENCODING` The default encoding, ISO style, ISO style.

Constructor Summary
`Encodings()`

Method Summary
`static java.lang.String` | `convertJava2MimeEncoding(java.lang.String encoding)` Try the best we can to convert a Java encoding to a XML-style encoding.
`static java.lang.String` | `convertMime2JavaEncoding(java.lang.String encoding)` Try the best we can to convert a Java encoding to a XML-style encoding.
`static java.lang.Object` | `getCharToByteConverter(java.lang.String encoding)` Returns an opaque CharToByte converter for the specified encoding.
`static int` | `getLastPrintable()` Returns the last printable character for an unspecified encoding.
`static int` | `getLastPrintable(java.lang.String encoding)` Returns the last printable character for the specified encoding.
`static java.lang.String` | `getMimeEncoding(java.lang.String encoding)` Get the proper mime encoding.
`static java.io.Writer` | `getWriter(java.io.OutputStream output, java.lang.String encoding)` Returns a writer for the specified encoding based on an output stream.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_MIME_ENCODING

    public static final java.lang.String DEFAULT_MIME_ENCODING

  The default encoding, ISO style, ISO style.

Constructor Detail

### Encodings

    public Encodings()

Method Detail

### getWriter

    public static java.io.Writer getWriter(java.io.OutputStream output,
                                           java.lang.String encoding)
                                    throws java.io.UnsupportedEncodingException

  Returns a writer for the specified encoding based on an output stream.

  Parameters:
    `output` - The output stream
    `encoding` - The encoding
  Returns:
    A suitable writer
  Throws:
    java.io.UnsupportedEncodingException - There is no convertor to support this encoding

### getCharToByteConverter

    public static java.lang.Object getCharToByteConverter(java.lang.String encoding)

  Returns an opaque CharToByte converter for the specified encoding.

  Parameters:
    `encoding` - The encoding
  Returns:
    An object which should be a sun.io.CharToByteConverter, or null.

### getLastPrintable

    public static int getLastPrintable(java.lang.String encoding)

  Returns the last printable character for the specified encoding.

  Parameters:
    `encoding` - The encoding
  Returns:
    The last printable character

### getLastPrintable

    public static int getLastPrintable()

  Returns the last printable character for an unspecified encoding.

  Returns:
    the default size

### getMimeEncoding

    public static java.lang.String getMimeEncoding(java.lang.String encoding)

  Get the proper mime encoding. From the XSLT recommendation: "The encoding attribute specifies the preferred encoding to use for outputting the result tree. XSLT processors are required to respect values of UTF-8 and UTF-16. For other values, if the XSLT processor does not support the specified encoding it may signal an error; if it does not signal an error it should use UTF-8 or UTF-16 instead. The XSLT processor must not use an encoding whose name does not match the EncName production of the XML Recommendation [XML]. If no encoding attribute is specified, then the XSLT processor should use either UTF-8 or UTF-16."

  Parameters:
    `encoding` - Reference to java-style encoding string, which may be null, in which case a default will be found.
  Returns:
    The ISO-style encoding string, or null if failure.

### convertJava2MimeEncoding

    public static java.lang.String convertJava2MimeEncoding(java.lang.String encoding)

  Try the best we can to convert a Java encoding to a XML-style encoding.

  Parameters:
    `encoding` - non-null reference to encoding string, java style.
  Returns:
    ISO-style encoding string.

### convertMime2JavaEncoding

    public static java.lang.String convertMime2JavaEncoding(java.lang.String encoding)

  Try the best we can to convert a Java encoding to a XML-style encoding.

  Parameters:
    `encoding` - non-null reference to encoding string, java style.
  Returns:
    ISO-style encoding string.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs70
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 BEA Systems, Inc. All Rights Reserved.
WebLogic Server 7.0 API Reference