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
Interface Serializer

All Known Implementing Classes:
  SerializerToXML

public interface Serializer

The Serializer interface is implemented by Serializers to publish methods to get and set streams and writers, to set the output properties, and get the Serializer as a ContentHandler or DOMSerializer.

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.

Method Summary
`org.xml.sax.ContentHandler` | `asContentHandler()` Return a `ContentHandler` interface into this serializer.
`DOMSerializer` | `asDOMSerializer()` Return a `DOMSerializer` interface into this serializer.
`java.util.Properties` | `getOutputFormat()` Returns the output format for this serializer.
`java.io.OutputStream` | `getOutputStream()` Get the output stream where the events will be serialized to.
`java.io.Writer` | `getWriter()` Get the character stream where the events will be serialized to.
`boolean` | `reset()` Resets the serializer.
`void` | `setOutputFormat(java.util.Properties format)` Specifies an output format for this serializer.
`void` | `setOutputStream(java.io.OutputStream output)` Specifies an output stream to which the document should be serialized.
`void` | `setWriter(java.io.Writer writer)` Specifies a writer to which the document should be serialized.

Method Detail

### setOutputStream

    public void setOutputStream(java.io.OutputStream output)

  Specifies an output stream to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document.

  The encoding specified in the output `Properties` is used, or if no encoding was specified, the default for the selected output method.

  Parameters:
    `output` - The output stream

### getOutputStream

    public java.io.OutputStream getOutputStream()

  Get the output stream where the events will be serialized to.

  Returns:
    reference to the result stream, or null of only a writer was set.

### setWriter

    public void setWriter(java.io.Writer writer)

  Specifies a writer to which the document should be serialized. This method should not be called while the serializer is in the process of serializing a document.

  The encoding specified for the output `Properties` must be identical to the output format used with the writer.

  Parameters:
    `writer` - The output writer stream

### getWriter

    public java.io.Writer getWriter()

  Get the character stream where the events will be serialized to.

  Returns:
    Reference to the result Writer, or null.

### setOutputFormat

    public void setOutputFormat(java.util.Properties format)

  Specifies an output format for this serializer. It the serializer has already been associated with an output format, it will switch to the new format. This method should not be called while the serializer is in the process of serializing a document.

  Parameters:
    `format` - The output format to use

### getOutputFormat

    public java.util.Properties getOutputFormat()

  Returns the output format for this serializer.

  Returns:
    The output format in use

### asContentHandler

    public org.xml.sax.ContentHandler asContentHandler()
                                                throws java.io.IOException

  Return a `ContentHandler` interface into this serializer. If the serializer does not support the `ContentHandler` interface, it should return null.

  Returns:
    A `ContentHandler` interface into this serializer, or null if the serializer is not SAX 2 capable
  Throws:
    java.io.IOException - An I/O exception occured

### asDOMSerializer

    public DOMSerializer asDOMSerializer()
                                  throws java.io.IOException

  Return a `DOMSerializer` interface into this serializer. If the serializer does not support the `DOMSerializer` interface, it should return null.

  Returns:
    A `DOMSerializer` interface into this serializer, or null if the serializer is not DOM capable
  Throws:
    java.io.IOException - An I/O exception occured

### reset

    public boolean reset()

  Resets the serializer. If this method returns true, the serializer may be used for subsequent serialization of new documents. It is possible to change the output format and output stream prior to serializing, or to use the existing output format and output stream.

  Returns:
    True if serializer has been reset and can be reused

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