Class 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 Details

  • Constructor Details

    • TransformerReceiver

      public TransformerReceiver(Controller controller)
      Create a TransformerHandlerImpl and initialise variables.
  • Method Details

    • open

      public void open() throws XPathException
      Start of event stream
      Specified by:
      open in interface Receiver
      Overrides:
      open in class ProxyReceiver
      Throws:
      XPathException
    • getTransformer

      public Transformer getTransformer()
      Get the Transformer used for this transformation
    • setSystemId

      public void setSystemId(String systemId)
      Set the SystemId of the document
      Specified by:
      setSystemId in interface Receiver
      Specified by:
      setSystemId in interface Result
      Overrides:
      setSystemId in class ProxyReceiver
      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 interface Receiver
      Overrides:
      startElement in class ProxyReceiver
      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.
      locationId - an integer which can be interpreted using a LocationProvider to return information such as line number and system ID. If no location information is available, the value zero is supplied.
      properties - bit-significant properties of the element node.
      Throws:
      XPathException
    • setResult

      public void setResult(Result result)
      Set the output destination of the transformation
    • getResult

      public 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 interface Receiver
      Overrides:
      close in class ProxyReceiver
      Throws:
      XPathException