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:
    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 inherited from class net.sf.saxon.event.ProxyReceiver

      `nextReceiver`

    - ### Fields inherited from class net.sf.saxon.event.SequenceReceiver

      `pipelineConfiguration, previousAtomic, systemId`

    - ### Fields inherited from interface javax.xml.transform.Result

      `PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TransformerReceiver(Controller controller)` Create a TransformerReceiver and initialise variables.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Override the behaviour of close() in ProxyReceiver, so that it fires off the transformation of the constructed document
    `Result` | `getResult()` Get the output destination of the transformation
    `Transformer` | `getTransformer()` Get the Transformer used for this transformation
    `void` | `open()` Start of event stream
    `void` | `setResult(Result result)` Set the output destination of the transformation.
    `void` | `setSystemId(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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TransformerReceiver

          public TransformerReceiver(Controller controller)

      Create a TransformerReceiver and initialise variables.
      Parameters:
        `controller` - the Controller (Saxon's implementation of the JAXP `Transformer`)

  - ### Method Detail

    - #### open

          public void open()
                    throws XPathException

      Start of event stream
      Specified by:
        `open` in interface `Receiver`
      Overrides:
        `open` in class `ProxyReceiver`
      Throws:
        `XPathException` - if an error occurs

    - #### getTransformer

          public Transformer getTransformer()

      Get the Transformer used for this transformation
      Returns:
        the transformer (which will always be an instance of `Controller`)

    - #### setSystemId

          public void setSystemId(String systemId)

      Set the SystemId of the document
      Specified by:
        `setSystemId` in interface `Result`
      Specified by:
        `setSystemId` in interface `Receiver`
      Overrides:
        `setSystemId` in class `ProxyReceiver`
      Parameters:
        `systemId` - the URI used to identify the tree being passed across this interface

    - #### setResult

          public void setResult(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 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 XPathException

      Override the behaviour of close() in ProxyReceiver, so that it fires off the transformation of the constructed document
      Specified by:
        `close` in interface `Receiver`
      Overrides:
        `close` in class `ProxyReceiver`
      Throws:
        `XPathException` - if an error occurs

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.