public abstract class

SerializerFactory

extends Object
java.lang.Object
   ↳ org.apache.xml.serialize.SerializerFactory

This class is deprecated.
This class was deprecated in Xerces 2.9.0. It is recommended that new applications use the DOM Level 3 LSSerializer or JAXP's Transformation API for XML (TrAX) for serializing XML and HTML. See the Xerces documentation for more information.

Summary

Constants
String FactoriesProperty
Public Constructors
SerializerFactory()
Public Methods
static SerializerFactory getSerializerFactory(String method)
Register a serializer factory, keyed by the given method string.
abstract Serializer makeSerializer(OutputStream output, OutputFormat format)
Create a new serializer, based on the OutputFormat and using the output byte stream and the encoding specified in the output format.
abstract Serializer makeSerializer(Writer writer, OutputFormat format)
Create a new serializer, based on the OutputFormat and using the writer as the output character stream.
abstract Serializer makeSerializer(OutputFormat format)
Create a new serializer based on the OutputFormat.
static void registerSerializerFactory(SerializerFactory factory)
Register a serializer factory, keyed by the given method string.
Protected Methods
abstract String getSupportedMethod()
Returns the method supported by this factory and used to register the factory.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String FactoriesProperty

Constant Value: "org.apache.xml.serialize.factories"

Public Constructors

public SerializerFactory ()

Public Methods

public static SerializerFactory getSerializerFactory (String method)

Register a serializer factory, keyed by the given method string.

public abstract Serializer makeSerializer (OutputStream output, OutputFormat format)

Create a new serializer, based on the OutputFormat and using the output byte stream and the encoding specified in the output format.

Throws
UnsupportedEncodingException The specified encoding is not supported

public abstract Serializer makeSerializer (Writer writer, OutputFormat format)

Create a new serializer, based on the OutputFormat and using the writer as the output character stream. If this method is used, the encoding property will be ignored.

public abstract Serializer makeSerializer (OutputFormat format)

Create a new serializer based on the OutputFormat. If this method is used to create the serializer, the setOutputByteStream(OutputStream) or setOutputCharStream(Writer) methods must be called before serializing a document.

public static void registerSerializerFactory (SerializerFactory factory)

Register a serializer factory, keyed by the given method string.

Protected Methods

protected abstract String getSupportedMethod ()

Returns the method supported by this factory and used to register the factory. This call is required so factories can be added from a properties file by knowing only the class name. This method is protected, it is only required by this class but must be implemented in derived classes.