Package com.saxonica.ee.stream.adjunct
Class SwitchAdjunct
java.lang.Object
com.saxonica.ee.stream.adjunct.StreamingAdjunct
com.saxonica.ee.stream.adjunct.TransmissionAdjunct
com.saxonica.ee.stream.adjunct.SwitchAdjunct
- All Implemented Interfaces:
FeedMaker
Streaming code to implement a switch expression, which results from optimizing a choose where all the
branches have similar test conditions. Unlike a choose, the conditions cannot be consuming: this is
because the conditions must be similar, and if one is consuming then several will be consuming.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetWatchMaker
(boolean forGrouping) Get a WatchMaker, a factory class that creates a Watch to evaluate this expression in streaming mode.makeItemFeed
(WatchManager watchManager, ItemFeed out, XPathContext context) makeTransmissionFlow
(WatchManager watchManager, Expression exp, ItemFeed out, XPathContext context) Make a Trigger that implements this expression in streaming mode.void
setExpression
(Expression expression) Set the expression being processed by this StreamingAdjunctMethods inherited from class com.saxonica.ee.stream.adjunct.StreamingAdjunct
computeStreamability, emptyAdjunctMap, findConsumingArg, genId, getConfiguration, getDefaultFeedMaker, getExpression, getFeedMaker, makeStreamingAdjunct, setConfiguration, toStreamingPattern
-
Constructor Details
-
SwitchAdjunct
public SwitchAdjunct()
-
-
Method Details
-
setExpression
Description copied from class:StreamingAdjunct
Set the expression being processed by this StreamingAdjunct- Overrides:
setExpression
in classStreamingAdjunct
- Parameters:
expression
- the expression being processed
-
getWatchMaker
Description copied from class:StreamingAdjunct
Get a WatchMaker, a factory class that creates a Watch to evaluate this expression in streaming mode. This method will only be called if the getImplementationMethod() method of the expression includes the valueExpression.WATCH_METHOD
- Overrides:
getWatchMaker
in classTransmissionAdjunct
- Parameters:
forGrouping
- true if the selected items are being grouped- Returns:
- a Watchmaker to evaluate the expression, or null if it is not streamable with respect to the specificed argument.
- Throws:
XPathException
- in the event of a failure
-
makeTransmissionFlow
public Trigger makeTransmissionFlow(WatchManager watchManager, Expression exp, ItemFeed out, XPathContext context) throws XPathException Description copied from class:TransmissionAdjunct
Make a Trigger that implements this expression in streaming mode. This method is used for an expression that is striding or crawling, and it delivers a Trigger connected to a sequence of Feeds which together have the effect of delivering a sequence of events and/or items that together represent the results of this instruction. This method MUST be implemented for every expression that has an operand whose usage is transmission (and for every such operand).- Overrides:
makeTransmissionFlow
in classTransmissionAdjunct
- Parameters:
watchManager
- the WatchManager that fires this triggerexp
- the expressionout
- the next action in the push pipeline for evaluationcontext
- the XPath dynamic context- Returns:
- the Trigger (a Watch with a pattern)
- Throws:
XPathException
- if a dynamic evaluation error occurs.
-
makeItemFeed
public ItemFeed makeItemFeed(WatchManager watchManager, ItemFeed out, XPathContext context) throws XPathException - Throws:
XPathException
-