org.apache.xml.serialize

Class SerializerFactory


public abstract class SerializerFactory
extends java.lang.Object

Version:
$Revision: 476047 $ $Date: 2006-11-16 23:27:45 -0500 (Thu, 16 Nov 2006) $
Authors:
Scott Boag
Assaf Arkin

Field Summary

static String
FactoriesProperty

Method Summary

static SerializerFactory
getSerializerFactory(String method)
Register a serializer factory, keyed by the given method string.
protected abstract String
getSupportedMethod()
Returns the method supported by this factory and used to register the factory.
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.

Field Details

FactoriesProperty

public static final String FactoriesProperty

Method Details

getSerializerFactory

public static SerializerFactory getSerializerFactory(String method)
Register a serializer factory, keyed by the given method string.

getSupportedMethod

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.

makeSerializer

public abstract Serializer makeSerializer(OutputStream output,
                                          OutputFormat format)
            throws UnsupportedEncodingException
Create a new serializer, based on the OutputFormat and using the output byte stream and the encoding specified in the output format.

makeSerializer

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.

makeSerializer

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

registerSerializerFactory

public static void registerSerializerFactory(SerializerFactory factory)
Register a serializer factory, keyed by the given method string.

Copyright B) 1999-2006 The Apache Software Foundation. All Rights Reserved.