public class SerializerFactory extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
(package private) Configuration |
config |
Constructor and Description |
---|
SerializerFactory(Configuration config)
Create a SerializerFactory
|
Modifier and Type | Method and Description |
---|---|
protected Receiver |
createHTMLSerializer(Emitter emitter,
Properties props,
PipelineConfiguration pipe,
CharacterMapExpander characterMapExpander,
ProxyReceiver normalizer)
Create a serialization pipeline to implement the HTML output method.
|
protected Receiver |
createSaxonSerializationMethod(String method,
Properties props,
PipelineConfiguration pipe,
CharacterMapExpander characterMapExpander,
ProxyReceiver normalizer) |
protected Receiver |
createTextSerializer(Emitter emitter,
Properties props,
PipelineConfiguration pipe,
CharacterMapExpander characterMapExpander,
ProxyReceiver normalizer)
Create a serialization pipeline to implement the text output method.
|
protected Receiver |
createUserDefinedOutputMethod(String method,
Properties props,
PipelineConfiguration pipe)
Create a serialization pipeline to implement a user-defined output method.
|
protected Receiver |
createXHTMLSerializer(Emitter emitter,
Properties props,
PipelineConfiguration pipe,
CharacterMapExpander characterMapExpander,
ProxyReceiver normalizer)
Create a serialization pipeline to implement the XHTML output method.
|
protected Receiver |
createXMLSerializer(Emitter emitter,
Properties props,
PipelineConfiguration pipe,
CharacterMapExpander characterMapExpander,
ProxyReceiver normalizer)
Create a serialization pipeline to implement the XML output method.
|
Receiver |
getReceiver(Result result,
PipelineConfiguration pipe,
Properties props)
Get a Receiver that wraps a given Result object.
|
Receiver |
getReceiver(Result result,
PipelineConfiguration pipe,
Properties props,
CharacterMapIndex charMapIndex)
Get a Receiver that wraps a given Result object.
|
StreamWriterToReceiver |
getXMLStreamWriter(StreamResult result,
Properties properties)
Create a serializer with given output properties, and return
an XMLStreamWriter that can be used to feed events to the serializer.
|
protected ProxyReceiver |
newCDATAFilter(PipelineConfiguration pipe,
Properties outputProperties)
Create a new CDATA Filter, responsible for insertion of CDATA sections where required.
|
CharacterMapExpander |
newCharacterMapExpander()
Create a new CharacterMapExpander.
|
protected ContentHandlerProxy |
newContentHandlerProxy()
Create a ContentHandlerProxy.
|
protected Emitter |
newHTMLEmitter()
Create a new HTML Emitter.
|
protected ProxyReceiver |
newHTMLIndenter(PipelineConfiguration pipe,
Properties outputProperties)
Create a new HTML Indenter.
|
protected MetaTagAdjuster |
newHTMLMetaTagAdjuster(PipelineConfiguration pipe,
Properties outputProperties)
Create a new XHTML MetaTagAdjuster, responsible for insertion, removal, or replacement of meta
elements.
|
protected ProxyReceiver |
newHTMLURIEscaper(PipelineConfiguration pipe,
Properties outputProperties)
Create a new HTML URI Escaper, responsible for percent-encoding of URIs in
HTML output documents.
|
protected Emitter |
newTEXTEmitter()
Create a new Text Emitter.
|
protected UncommittedSerializer |
newUncommittedSerializer(Result result,
Properties properties)
Create an UncommittedSerializer.
|
protected ProxyReceiver |
newUnicodeNormalizer(PipelineConfiguration pipe,
Properties outputProperties)
Create a Unicode Normalizer.
|
protected Emitter |
newXHTMLEmitter()
Create a new XHTML Emitter.
|
protected ProxyReceiver |
newXHTMLIndenter(PipelineConfiguration pipe,
Properties outputProperties)
Create a new XHTML Indenter.
|
protected MetaTagAdjuster |
newXHTMLMetaTagAdjuster(PipelineConfiguration pipe,
Properties outputProperties)
Create a new XHTML MetaTagAdjuster, responsible for insertion, removal, or replacement of meta
elements.
|
protected ProxyReceiver |
newXHTMLURIEscaper(PipelineConfiguration pipe,
Properties outputProperties)
Create a new XHTML URI Escaper, responsible for percent-encoding of URIs in
HTML output documents.
|
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).
|
protected Emitter |
newXMLEmitter()
Create a new XML Emitter.
|
protected ProxyReceiver |
newXMLIndenter(PipelineConfiguration pipe,
Properties outputProperties)
Create a new XML Indenter.
|
Configuration config
public SerializerFactory(Configuration config)
config
- the Saxon Configurationpublic StreamWriterToReceiver getXMLStreamWriter(StreamResult result, Properties properties) throws XPathException
result
- the destination of the serialized output (wraps a Writer, an OutputStream, or a File).
The returned object implements XMLStreamWriter
, but is not declared
as such to enable the product to load under JDK 1.5.properties
- the serialization properties to be usedXPathException
public Receiver getReceiver(Result result, PipelineConfiguration pipe, Properties props) throws XPathException
Note that this method ignores the SaxonOutputKeys.WRAP
output property. If
wrapped output is required, the user must create a SequenceWrapper
directly.
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. If this includes the property SaxonOutputKeys.USE_CHARACTER_MAPS
then the PipelineConfiguration must contain a non-null Controller, and the Executable associated with this Controller
must have a CharacterMapIndex which is used to resolve the names of the character maps appearing in this property.XPathException
public Receiver getReceiver(Result result, PipelineConfiguration pipe, Properties props, CharacterMapIndex charMapIndex) throws XPathException
Note that this method ignores the SaxonOutputKeys.WRAP
output property. If
wrapped output is required, the user must create a SequenceWrapper
directly.
result
- The final destination of the serialized output. Usually a StreamResult,
but other kinds of Result are possible.pipe
- The PipelineConfiguration.props
- The serialization propertiescharMapIndex
- The index of character maps. Required if any of the serialization properties
is SaxonOutputKeys.USE_CHARACTER_MAPS
, in which case the named character maps listed in that
property must be present in the index of character maps.XPathException
protected Receiver createHTMLSerializer(Emitter emitter, Properties props, PipelineConfiguration pipe, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) throws XPathException
emitter
- the emitter at the end of the pipeline (created using the method newHTMLEmitter()
props
- the serialization propertiespipe
- the pipeline configuration informationcharacterMapExpander
- the filter to be used for expanding character maps defined in the stylesheetnormalizer
- the filter used for Unicode normalizationXPathException
- if a failure occursprotected Receiver createTextSerializer(Emitter emitter, Properties props, PipelineConfiguration pipe, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) throws XPathException
emitter
- the emitter at the end of the pipeline (created using the method newTEXTEmitter()
props
- the serialization propertiespipe
- the pipeline configuration informationcharacterMapExpander
- the filter to be used for expanding character maps defined in the stylesheetnormalizer
- the filter used for Unicode normalizationXPathException
- if a failure occursprotected Receiver createXHTMLSerializer(Emitter emitter, Properties props, PipelineConfiguration pipe, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) throws XPathException
emitter
- the emitter at the end of the pipeline (created using the method newXHTMLEmitter()
props
- the serialization propertiespipe
- the pipeline configuration informationcharacterMapExpander
- the filter to be used for expanding character maps defined in the stylesheetnormalizer
- the filter used for Unicode normalizationXPathException
- if a failure occursprotected Receiver createXMLSerializer(Emitter emitter, Properties props, PipelineConfiguration pipe, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) throws XPathException
emitter
- the emitter at the end of the pipeline (created using the method newXHTMLEmitter()
props
- the serialization propertiespipe
- the pipeline configuration informationcharacterMapExpander
- the filter to be used for expanding character maps defined in the stylesheetnormalizer
- the filter used for Unicode normalizationXPathException
- if a failure occursprotected Receiver createSaxonSerializationMethod(String method, Properties props, PipelineConfiguration pipe, CharacterMapExpander characterMapExpander, ProxyReceiver normalizer) throws XPathException
XPathException
protected Receiver createUserDefinedOutputMethod(String method, Properties props, PipelineConfiguration pipe) throws XPathException
method
- the name of the user-defined output method, as a QName in Clark format
(that is "{uri}local").props
- the serialization propertiespipe
- the pipeline configuration informationXPathException
- if a failure occursprotected ContentHandlerProxy newContentHandlerProxy()
protected UncommittedSerializer newUncommittedSerializer(Result result, Properties properties)
result
- the result destinationproperties
- the serialization propertiesprotected Emitter newXMLEmitter()
protected Emitter newHTMLEmitter()
protected Emitter newXHTMLEmitter()
protected Emitter newTEXTEmitter()
protected ProxyReceiver newXMLIndenter(PipelineConfiguration pipe, Properties outputProperties)
pipe
- the pipeline configurationoutputProperties
- the serialization parametersprotected ProxyReceiver newHTMLIndenter(PipelineConfiguration pipe, Properties outputProperties)
pipe
- the pipeline configurationoutputProperties
- the serialization parametersprotected ProxyReceiver newXHTMLIndenter(PipelineConfiguration pipe, Properties outputProperties)
pipe
- the pipeline configurationoutputProperties
- the serialization parametersprotected MetaTagAdjuster newXHTMLMetaTagAdjuster(PipelineConfiguration pipe, Properties outputProperties)
pipe
- the pipeline configurationoutputProperties
- the serialization parametersprotected MetaTagAdjuster newHTMLMetaTagAdjuster(PipelineConfiguration pipe, Properties outputProperties)
pipe
- the pipeline configurationoutputProperties
- the serialization parametersprotected ProxyReceiver newHTMLURIEscaper(PipelineConfiguration pipe, Properties outputProperties)
pipe
- the pipeline configurationoutputProperties
- the serialization parametersprotected ProxyReceiver newXHTMLURIEscaper(PipelineConfiguration pipe, Properties outputProperties)
pipe
- the pipeline configurationoutputProperties
- the serialization parametersprotected ProxyReceiver newCDATAFilter(PipelineConfiguration pipe, Properties outputProperties) throws XPathException
pipe
- the pipeline configurationoutputProperties
- the serialization parametersXPathException
protected ProxyReceiver newXML10ContentChecker(PipelineConfiguration pipe, Properties outputProperties)
pipe
- the pipeline configurationoutputProperties
- the serialization parametersprotected ProxyReceiver newUnicodeNormalizer(PipelineConfiguration pipe, Properties outputProperties) throws XPathException
pipe
- the pipeline configurationoutputProperties
- the serialization parametersXPathException
public CharacterMapExpander newCharacterMapExpander()