Package net.sf.saxon.event
Class Emitter
java.lang.Object
net.sf.saxon.event.Emitter
- Direct Known Subclasses:
XMLEmitter
Emitter: This abstract class defines methods that must be implemented by
components that format SAXON output. There is one emitter for XML,
one for HTML, and so on. Additional methods are concerned with
setting options and providing a Writer.
The interface is deliberately designed to be as close as possible to the standard SAX2 ContentHandler interface, however, it allows additional information to be made available. An Emitter is a Receiver, specifically it is a Receiver that can direct output to a Writer or OutputStream, using serialization properties defined in a Properties object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected CharacterSet
protected NamePool
protected Properties
protected OutputStream
protected PipelineConfiguration
protected StreamResult
protected String
protected Writer
Fields inherited from interface javax.xml.transform.Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the configuration used for this documentGet the output propertiesGet the output streamGet the pipeline configuration used for this documentGet the System IDGet the output writerprotected void
Make a Writer for this Emitter to use, given a StreamResultvoid
setOutputProperties
(Properties details) Set output propertiesvoid
setOutputStream
(OutputStream stream) Set the output destination as a byte streamvoid
Set the pipelineConfigurationvoid
setStreamResult
(StreamResult result) Set the StreamResult acting as the output destination of the Emittervoid
setSystemId
(String systemId) Set the System IDvoid
setUnparsedEntity
(String name, String uri, String publicId) Set unparsed entity URI.void
Set the output destination as a character streamboolean
Determine whether the Emitter wants a Writer for character output or an OutputStream for binary output.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.saxon.event.Receiver
attribute, characters, close, comment, endDocument, endElement, namespace, open, processingInstruction, startContent, startDocument, startElement
-
Field Details
-
pipelineConfig
-
namePool
-
systemId
-
streamResult
-
writer
-
outputStream
-
outputProperties
-
characterSet
-
allCharactersEncodable
protected boolean allCharactersEncodable
-
-
Constructor Details
-
Emitter
public Emitter()
-
-
Method Details
-
setPipelineConfiguration
Set the pipelineConfiguration- Specified by:
setPipelineConfiguration
in interfaceReceiver
-
getPipelineConfiguration
Get the pipeline configuration used for this document- Specified by:
getPipelineConfiguration
in interfaceReceiver
-
getConfiguration
Get the configuration used for this document -
setSystemId
Set the System ID- Specified by:
setSystemId
in interfaceReceiver
- Specified by:
setSystemId
in interfaceResult
-
getSystemId
Get the System ID- Specified by:
getSystemId
in interfaceResult
-
setOutputProperties
Set output properties- Throws:
XPathException
-
getOutputProperties
Get the output properties -
setStreamResult
Set the StreamResult acting as the output destination of the Emitter- Throws:
XPathException
-
makeWriter
Make a Writer for this Emitter to use, given a StreamResult- Throws:
XPathException
-
usesWriter
public boolean usesWriter()Determine whether the Emitter wants a Writer for character output or an OutputStream for binary output. The standard Emitters all use a Writer, so this returns true; but a subclass can override this if it wants to use an OutputStream -
setWriter
Set the output destination as a character stream -
getWriter
Get the output writer -
setOutputStream
Set the output destination as a byte stream- Throws:
XPathException
-
getOutputStream
Get the output stream -
setUnparsedEntity
Set unparsed entity URI. Needed to satisfy the Receiver interface, but not used, because unparsed entities can occur only in input documents, not in output documents.- Specified by:
setUnparsedEntity
in interfaceReceiver
- Parameters:
name
- The name of the unparsed entityuri
- The system identifier of the unparsed entitypublicId
- The public identifier of the unparsed entity- Throws:
XPathException
-