|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.serialize.Emitter
public abstract class Emitter
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 | |
---|---|
protected boolean |
allCharactersEncodable
|
protected CharacterSet |
characterSet
|
protected NamePool |
namePool
|
protected Properties |
outputProperties
|
protected OutputStream |
outputStream
|
protected PipelineConfiguration |
pipelineConfig
|
protected StreamResult |
streamResult
|
protected String |
systemId
|
protected Writer |
writer
|
Fields inherited from interface javax.xml.transform.Result |
---|
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary | |
---|---|
Emitter()
|
Method Summary | |
---|---|
void |
close()
Notify the end of the event stream |
Configuration |
getConfiguration()
Get the configuration used for this document |
Properties |
getOutputProperties()
Get the output properties |
OutputStream |
getOutputStream()
Get the output stream |
PipelineConfiguration |
getPipelineConfiguration()
Get the pipeline configuration used for this document |
String |
getSystemId()
Get the System ID |
Writer |
getWriter()
Get the output writer |
protected OutputStream |
makeOutputStream()
|
protected void |
makeWriter()
Make a Writer for this Emitter to use, given a StreamResult. |
void |
setOutputProperties(Properties details)
Set output properties |
void |
setOutputStream(OutputStream stream)
Set the output destination as a byte stream. |
void |
setPipelineConfiguration(PipelineConfiguration pipe)
Set the pipelineConfiguration |
void |
setStreamResult(StreamResult result)
Set the StreamResult acting as the output destination of the Emitter |
void |
setSystemId(String systemId)
Set the System ID |
void |
setUnparsedEntity(String name,
String uri,
String publicId)
Set unparsed entity URI. |
void |
setWriter(Writer writer)
Set the output destination as a character stream |
boolean |
usesTypeAnnotations()
Ask whether this Receiver (or the downstream pipeline) makes any use of the type annotations supplied on element and attribute events |
boolean |
usesWriter()
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, comment, endDocument, endElement, namespace, open, processingInstruction, startContent, startDocument, startElement |
Field Detail |
---|
protected PipelineConfiguration pipelineConfig
protected NamePool namePool
protected String systemId
protected StreamResult streamResult
protected Writer writer
protected OutputStream outputStream
protected Properties outputProperties
protected CharacterSet characterSet
protected boolean allCharactersEncodable
Constructor Detail |
---|
public Emitter()
Method Detail |
---|
public void setPipelineConfiguration(PipelineConfiguration pipe)
setPipelineConfiguration
in interface Receiver
pipe
- the pipeline configurationpublic PipelineConfiguration getPipelineConfiguration()
getPipelineConfiguration
in interface Receiver
public Configuration getConfiguration()
public void setSystemId(String systemId)
setSystemId
in interface Result
setSystemId
in interface Receiver
systemId
- the system identifier (=base URI)public String getSystemId()
getSystemId
in interface Result
public void setOutputProperties(Properties details) throws XPathException
details
- the output serialization properties
XPathException
- if an error occurs finding the encoding propertypublic Properties getOutputProperties()
public void setStreamResult(StreamResult result) throws XPathException
result
- the output destination
XPathException
- if an error occursprotected void makeWriter() throws XPathException
XPathException
- if an error occursprotected OutputStream makeOutputStream() throws XPathException
XPathException
public boolean usesWriter()
public void setWriter(Writer writer) throws XPathException
writer
- the Writer to use as an output destination
XPathException
- if an error occurspublic Writer getWriter()
public void setOutputStream(OutputStream stream) throws XPathException
Note that if a specific encoding (other than the default, UTF-8) is required, then
setOutputProperties(java.util.Properties)
must be called before calling
this method.
stream
- the OutputStream being used as an output destination
XPathException
- if an error occurspublic OutputStream getOutputStream()
public void setUnparsedEntity(String name, String uri, String publicId) throws XPathException
setUnparsedEntity
in interface Receiver
name
- the entity nameuri
- the entity system IDpublicId
- the entity public ID
XPathException
- if an error occurspublic void close() throws XPathException
close
in interface Receiver
XPathException
- if an error occurspublic boolean usesTypeAnnotations()
usesTypeAnnotations
in interface Receiver
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |