com.saxonica.stream.watch
Class EventPushingWatch

java.lang.Object
  extended by com.saxonica.validate.AbstractWatch
      extended by com.saxonica.stream.watch.EventPushingWatch
All Implemented Interfaces:
Watch
Direct Known Subclasses:
ApplyTemplatesWatch, ForEachWatch, IterateWatch

public abstract class EventPushingWatch
extends AbstractWatch

A EvaluatingWatch is a Watch that evaluates an expression based on the nodes encountered in a streamed input document, appending the value of that expression to the Watch for the next expression in the streaming route.


Constructor Summary
EventPushingWatch(Expression expression, SequenceReceiver result, Stack<XPathContext> contextStack)
           
 
Method Summary
 void close()
          The close() method is called immediately before the Watch is destroyed, that is, when the element whose declaration scopes the constraint implemented by this Watch goes out of scope.
 XPathContext getContext()
           
 Stack<XPathContext> getContextStack()
           
 Expression getExpression()
           
 SequenceReceiver getResult()
           
 void open()
          Open the watch.
 void setParentExpressionFeed(Feed feed)
          Set a feed to be notified when this watch is opened and closed.
 void setResult(SequenceReceiver result)
           
 
Methods inherited from class com.saxonica.validate.AbstractWatch
getAnchorNode, getNamespaceResolver, getPipelineConfiguration, getSelection, notifySelectedLeafNode, setAnchorNode, setNamespaceResolver, setPipelineConfiguration, setSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.saxonica.stream.watch.Watch
endSelectedParentNode, startSelectedParentNode
 

Constructor Detail

EventPushingWatch

public EventPushingWatch(Expression expression,
                         SequenceReceiver result,
                         Stack<XPathContext> contextStack)
Method Detail

setResult

public void setResult(SequenceReceiver result)

getResult

public SequenceReceiver getResult()

getExpression

public Expression getExpression()

getContext

public XPathContext getContext()

getContextStack

public Stack<XPathContext> getContextStack()

setParentExpressionFeed

public void setParentExpressionFeed(Feed feed)
Set a feed to be notified when this watch is opened and closed. Typically this feed is a ComplexNodeEventFeed, which is responsible for outputting events representing the start and end of constructed elements produced by a parent expression.

Parameters:
feed - the feed to be notified when this Watch is opened or closed.

open

public void open()
          throws XPathException
Description copied from class: AbstractWatch
Open the watch. This is done at the point where it first starts watching for nodes that match the selection.

Specified by:
open in interface Watch
Overrides:
open in class AbstractWatch
Throws:
XPathException

close

public void close()
           throws XPathException
Description copied from class: AbstractWatch
The close() method is called immediately before the Watch is destroyed, that is, when the element whose declaration scopes the constraint implemented by this Watch goes out of scope. The default implementation does nothing.

Specified by:
close in interface Watch
Overrides:
close in class AbstractWatch
Throws:
XPathException


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