Package net.sf.saxon.event
Class SerializerFactory
java.lang.Object
net.sf.saxon.event.SerializerFactory
- All Implemented Interfaces:
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Receiver
createHTMLSerializer
(Emitter emitter, Properties props, PipelineConfiguration pipe, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) protected Receiver
createTextSerializer
(Emitter emitter, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) protected Receiver
createXHTMLSerializer
(Emitter emitter, Properties props, PipelineConfiguration pipe, ProxyReceiver normalizer, CharacterMapExpander characterMapExpander) protected Receiver
createXMLSerializer
(Emitter emitter, Properties props, PipelineConfiguration pipe, ProxyReceiver normalizer, CharacterMapExpander characterMapExpander) getReceiver
(Result result, PipelineConfiguration pipe, Properties props) Get a Receiver that wraps a given Result object.protected ProxyReceiver
newCDATAFilter
(PipelineConfiguration pipe, Properties outputProperties) Create a new CDATA Filter, responsible for insertion of CDATA sections where requiredCreate a new CharacterMapExpanderprotected ContentHandlerProxy
Create a ContentHandlerProxyprotected Emitter
Create a new HTML Emitterprotected ProxyReceiver
newHTMLIndenter
(PipelineConfiguration pipe, Properties outputProperties) Create a new HTML Indenterprotected MetaTagAdjuster
newHTMLMetaTagAdjuster
(PipelineConfiguration pipe, Properties outputProperties) Create a new XHTML MetaTagAdjuster, responsible for insertion, removal, or replacement of meta elementsprotected ProxyReceiver
newHTMLURIEscaper
(PipelineConfiguration pipe, Properties outputProperties) Create a new HTML URI Escaper, responsible for percent-encoding of URIs in HTML output documentsprotected Emitter
Create a new Text Emitterprotected UncommittedSerializer
newUncommittedSerializer
(Result result, Properties properties) Create an UncommittedSerializerprotected ProxyReceiver
newUnicodeNormalizer
(PipelineConfiguration pipe, Properties outputProperties) Create a Unicode Normalizerprotected Emitter
Create a new XHTML Emitterprotected ProxyReceiver
newXHTMLIndenter
(PipelineConfiguration pipe, Properties outputProperties) Create a new XHTML Indenterprotected MetaTagAdjuster
newXHTMLMetaTagAdjuster
(PipelineConfiguration pipe, Properties outputProperties) Create a new XHTML MetaTagAdjuster, responsible for insertion, removal, or replacement of meta elementsprotected ProxyReceiver
newXML10ContentChecker
(PipelineConfiguration pipe, Properties outputProperties) Create a new XML 1.0 content checker, responsible for checking that the output conforms to XML 1.0 rules (this is used only if the Configuration supports XML 1.1 but the specific output file requires XML 1.0)protected Emitter
Create a new XML Emitterprotected ProxyReceiver
newXMLIndenter
(PipelineConfiguration pipe, Properties outputProperties) Create a new XML Indenter
-
Constructor Details
-
SerializerFactory
public SerializerFactory()
-
-
Method Details
-
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.- 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- Throws:
XPathException
-
createHTMLSerializer
protected Receiver createHTMLSerializer(Emitter emitter, Properties props, PipelineConfiguration pipe, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) throws XPathException - Throws:
XPathException
-
createTextSerializer
protected Receiver createTextSerializer(Emitter emitter, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) -
createXHTMLSerializer
protected Receiver createXHTMLSerializer(Emitter emitter, Properties props, PipelineConfiguration pipe, ProxyReceiver normalizer, CharacterMapExpander characterMapExpander) throws XPathException - Throws:
XPathException
-
createXMLSerializer
protected Receiver createXMLSerializer(Emitter emitter, Properties props, PipelineConfiguration pipe, ProxyReceiver normalizer, CharacterMapExpander characterMapExpander) throws XPathException - Throws:
XPathException
-
newContentHandlerProxy
Create a ContentHandlerProxy -
newUncommittedSerializer
Create an UncommittedSerializer -
newXMLEmitter
Create a new XML Emitter -
newHTMLEmitter
Create a new HTML Emitter -
newXHTMLEmitter
Create a new XHTML Emitter -
newTEXTEmitter
Create a new Text Emitter -
newXMLIndenter
Create a new XML Indenter -
newHTMLIndenter
Create a new HTML Indenter -
newXHTMLIndenter
Create a new XHTML Indenter -
newXHTMLMetaTagAdjuster
protected MetaTagAdjuster newXHTMLMetaTagAdjuster(PipelineConfiguration pipe, Properties outputProperties) Create a new XHTML MetaTagAdjuster, responsible for insertion, removal, or replacement of meta elements -
newHTMLMetaTagAdjuster
protected MetaTagAdjuster newHTMLMetaTagAdjuster(PipelineConfiguration pipe, Properties outputProperties) Create a new XHTML MetaTagAdjuster, responsible for insertion, removal, or replacement of meta elements -
newHTMLURIEscaper
Create a new HTML URI Escaper, responsible for percent-encoding of URIs in HTML output documents -
newCDATAFilter
protected ProxyReceiver newCDATAFilter(PipelineConfiguration pipe, Properties outputProperties) throws XPathException Create a new CDATA Filter, responsible for insertion of CDATA sections where required- Throws:
XPathException
-
newXML10ContentChecker
protected ProxyReceiver newXML10ContentChecker(PipelineConfiguration pipe, Properties outputProperties) Create a new XML 1.0 content checker, responsible for checking that the output conforms to XML 1.0 rules (this is used only if the Configuration supports XML 1.1 but the specific output file requires XML 1.0) -
newUnicodeNormalizer
protected ProxyReceiver newUnicodeNormalizer(PipelineConfiguration pipe, Properties outputProperties) throws XPathException Create a Unicode Normalizer- Throws:
XPathException
-
newCharacterMapExpander
Create a new CharacterMapExpander
-