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) Builderbuilder(package private) Controllercontroller(package private) javax.xml.transform.Resultresult-
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 TransformerReceiver and initialise variables.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Override the behaviour of close() in ProxyReceiver, so that it fires off the transformation of the constructed documentjavax.xml.transform.ResultgetResult()Get the output destination of the transformationjavax.xml.transform.TransformergetTransformer()Get the Transformer used for this transformationvoidopen()Start of event streamvoidsetResult(javax.xml.transform.Result result)Set the output destination of the transformation.voidsetSystemId(java.lang.String systemId)Set the SystemId of the document-
Methods inherited from class net.sf.saxon.event.ProxyReceiver
append, attribute, characters, comment, endDocument, endElement, getNamePool, getUnderlyingReceiver, namespace, processingInstruction, setPipelineConfiguration, setUnderlyingReceiver, setUnparsedEntity, startContent, startDocument, startElement, usesTypeAnnotations
-
Methods inherited from class net.sf.saxon.event.SequenceReceiver
append, getConfiguration, 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 TransformerReceiver and initialise variables.- Parameters:
controller- the Controller (Saxon's implementation of the JAXPTransformer)
-
-
Method Detail
-
open
public void open() throws XPathExceptionStart of event stream- Specified by:
openin interfaceReceiver- Overrides:
openin classProxyReceiver- Throws:
XPathException- if an error occurs
-
getTransformer
public javax.xml.transform.Transformer getTransformer()
Get the Transformer used for this transformation- Returns:
- the transformer (which will always be an instance of
Controller)
-
setSystemId
public void setSystemId(java.lang.String systemId)
Set the SystemId of the document- Specified by:
setSystemIdin interfaceReceiver- Specified by:
setSystemIdin interfacejavax.xml.transform.Result- Overrides:
setSystemIdin classProxyReceiver- Parameters:
systemId- the URI used to identify the tree being passed across this interface
-
setResult
public void setResult(javax.xml.transform.Result result)
Set the output destination of the transformation. This method must be called before the transformation can proceed.- Parameters:
result- the destination to which the transformation output will be written
-
getResult
public javax.xml.transform.Result getResult()
Get the output destination of the transformation- Returns:
- the output destination. May be null if no destination has been set.
-
close
public void close() throws XPathExceptionOverride the behaviour of close() in ProxyReceiver, so that it fires off the transformation of the constructed document- Specified by:
closein interfaceReceiver- Overrides:
closein classProxyReceiver- Throws:
XPathException- if an error occurs
-
-