net.sf.saxon.event
Class SerializerFactory

java.lang.Object
  extended by net.sf.saxon.event.SerializerFactory
All Implemented Interfaces:
Serializable

public class SerializerFactory
extends Object
implements Serializable

Helper class to construct a serialization pipeline for a given result destination and a given set of output properties. The pipeline is represented by a Receiver object to which result tree events are sent. Since Saxon 8.8 is is possible to write a subclass of SerializerFactory and register it with the Configuration, allowing customisation of the Serializer pipeline. The class includes methods for instantiating each of the components used on the Serialization pipeline. This allows a customized SerializerFactory to replace any or all of these components by subclasses that refine the behaviour.

See Also:
Serialized Form

Constructor Summary
SerializerFactory()
          Create a SerializerFactory
 
Method Summary
 Receiver getReceiver(Result result, PipelineConfiguration pipe, Properties props)
          Get a Receiver that wraps a given Result object.
 CharacterMapExpander newCharacterMapExpander()
          Create a new CharacterMapExpander.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializerFactory

public SerializerFactory()
Create a SerializerFactory

Method Detail

getReceiver

public Receiver getReceiver(Result result,
                            PipelineConfiguration pipe,
                            Properties props)
                     throws XPathException
Get a Receiver that wraps a given Result object. Saxon calls this method to construct a serialization pipeline. The method can be overridden in a subclass; alternatively, the subclass can override the various methods used to instantiate components of the serialization pipeline.

Note that this method ignores the SaxonOutputKeys.WRAP output property. If wrapped output is required, the user must create a SequenceWrapper directly.

Parameters:
result - The final destination of the serialized output. Usually a StreamResult, but other kinds of Result are possible.
pipe - The PipelineConfiguration.
props - The serialization properties
Returns:
the newly constructed Receiver that performs the required serialization
Throws:
XPathException

newCharacterMapExpander

public CharacterMapExpander newCharacterMapExpander()
Create a new CharacterMapExpander. This method exists so that it can be overridden in a subclass.

Returns:
the newly created CharacterMapExpander.


Copyright (C) Michael H. Kay. All rights reserved.