Package net.sf.saxon.event
Class TransformerReceiver
- java.lang.Object
-
- net.sf.saxon.event.SequenceReceiver
-
- net.sf.saxon.event.ProxyReceiver
-
- net.sf.saxon.event.TransformerReceiver
-
- All Implemented Interfaces:
javax.xml.transform.Result
,Receiver
public class TransformerReceiver extends ProxyReceiver
TransformerReceiver is similar in concept to the JAXP TransformerHandler, except that it implements Saxon's Receiver interface rather than the standard SAX2 interface. This means that it allows nodes with type annotations to be passed down a pipeline from one transformation to another.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Builder
builder
(package private) Controller
controller
(package private) javax.xml.transform.Result
result
-
Fields inherited from class net.sf.saxon.event.ProxyReceiver
nextReceiver
-
Fields inherited from class net.sf.saxon.event.SequenceReceiver
pipelineConfiguration, previousAtomic, systemId
-
-
Constructor Summary
Constructors Constructor Description TransformerReceiver(Controller controller)
Create a TransformerHandlerImpl and initialise variables.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Override the behaviour of endDocument() in ProxyReceiver, so that it fires off the transformation of the constructed documentjavax.xml.transform.Result
getResult()
Get the output destination of the transformationjavax.xml.transform.Transformer
getTransformer()
Get the Transformer used for this transformationvoid
open()
Start of event streamvoid
setResult(javax.xml.transform.Result result)
Set the output destination of the transformationvoid
setSystemId(java.lang.String systemId)
Set the SystemId of the documentvoid
startElement(int nameCode, int typeCode, int locationId, int properties)
Notify the start of an element-
Methods inherited from class net.sf.saxon.event.ProxyReceiver
attribute, characters, comment, endDocument, endElement, getConfiguration, getDocumentLocator, getNamePool, getUnderlyingReceiver, namespace, processingInstruction, setPipelineConfiguration, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument
-
Methods inherited from class net.sf.saxon.event.SequenceReceiver
append, getPipelineConfiguration, getSystemId
-
-
-
-
Field Detail
-
controller
Controller controller
-
builder
Builder builder
-
result
javax.xml.transform.Result result
-
-
Constructor Detail
-
TransformerReceiver
public TransformerReceiver(Controller controller)
Create a TransformerHandlerImpl and initialise variables.
-
-
Method Detail
-
open
public void open() throws XPathException
Start of event stream- Specified by:
open
in interfaceReceiver
- Overrides:
open
in classProxyReceiver
- Throws:
XPathException
-
getTransformer
public javax.xml.transform.Transformer getTransformer()
Get the Transformer used for this transformation
-
setSystemId
public void setSystemId(java.lang.String systemId)
Set the SystemId of the document- Specified by:
setSystemId
in interfaceReceiver
- Specified by:
setSystemId
in interfacejavax.xml.transform.Result
- Overrides:
setSystemId
in classProxyReceiver
- Parameters:
systemId
- the URI used to identify the tree being passed across this interface
-
startElement
public void startElement(int nameCode, int typeCode, int locationId, int properties) throws XPathException
Notify the start of an element- Specified by:
startElement
in interfaceReceiver
- Overrides:
startElement
in classProxyReceiver
- Parameters:
nameCode
- integer code identifying the name of the element within the name pool.typeCode
- integer code identifying the element's type within the name pool.properties
- bit-significant properties of the element node.locationId
- an integer which can be interpreted using aLocationProvider
to return information such as line number and system ID. If no location information is available, the value zero is supplied.- Throws:
XPathException
-
setResult
public void setResult(javax.xml.transform.Result result)
Set the output destination of the transformation
-
getResult
public javax.xml.transform.Result getResult()
Get the output destination of the transformation
-
close
public void close() throws XPathException
Override the behaviour of endDocument() in ProxyReceiver, so that it fires off the transformation of the constructed document- Specified by:
close
in interfaceReceiver
- Overrides:
close
in classProxyReceiver
- Throws:
XPathException
-
-