Package net.sf.saxon.pull

## Class PullPushTee

- java.lang.Object
- - net.sf.saxon.pull.PullFilter
  - - net.sf.saxon.pull.PullPushTee

- All Implemented Interfaces:
    `PullProvider`

      public class PullPushTee
      extends PullFilter

  PullPushTee is a pass-through filter class that links one PullProvider to another PullProvider in a pipeline, copying all events that are read into a push pipeline, supplied in the form of a Receiver.

  This class can be used to insert a schema validator into a pull pipeline, since Saxon's schema validation is push-based. It could also be used to insert a serializer into the pipeline, allowing the XML document being "pulled" to be displayed for diagnostic purposes.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface net.sf.saxon.pull.PullProvider

      `PullProvider.Event`

  - ### Field Summary

    - ### Fields inherited from class net.sf.saxon.pull.PullFilter

      `currentEvent`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PullPushTee​(PullProvider base, Receiver branch)` | Create a PullPushTee

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Receiver` | `getReceiver()` | Get the Receiver to which events are being tee'd.
    `PullProvider.Event` | `next()` | Get the next event.

    - ### Methods inherited from class net.sf.saxon.pull.PullFilter

      `close, current, getAtomicValue, getAttributes, getNamePool, getNamespaceDeclarations, getNodeName, getPipelineConfiguration, getSchemaType, getSourceLocator, getStringValue, getUnderlyingProvider, getUnparsedEntities, setPipelineConfiguration, skipToMatchingEnd`

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

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

- - ### Constructor Detail

    - #### PullPushTee

          public PullPushTee​(PullProvider base,
                             Receiver branch)

      Create a PullPushTee
      Parameters:
        `base` - the PullProvider to which requests are to be passed
        `branch` - the Receiver to which all events are to be copied, as "push" events. This Receiver must already be open before use

  - ### Method Detail

    - #### getReceiver

          public Receiver getReceiver()

      Get the Receiver to which events are being tee'd.
      Returns:
        the Receiver

    - #### next

          public PullProvider.Event next()
                                  throws XPathException

      Get the next event. This implementation gets the next event from the underlying PullProvider, copies it to the branch Receiver, and then returns the event to the caller.
      Specified by:
        `next` in interface `PullProvider`
      Overrides:
        `next` in class `PullFilter`
      Returns:
        an integer code indicating the type of event. The code `PullProvider.Event.END_OF_INPUT` is returned at the end of the sequence.
      Throws:
        `XPathException` - if a dynamic error occurs