public class StreamingAdjunct extends Object
Expression
with methods used at compile-time
to support streaming, by generating a Watch
or Feed
that allows the expression to be evaluated in push mode.
There is a subclass for each kind of expression that can be evaluated in push mode. Typically such evaluation will either be at event granularity (a Watch) or at item granularity (a Feed). Most expressions implement one or the other. There is a fallback implementation that allows any expression to be evaluated as a Feed, but it involves buffering the input in memory and only evaluating the expression when all the input is available.
Constructor and Description |
---|
StreamingAdjunct() |
Modifier and Type | Method and Description |
---|---|
Configuration |
getConfiguration()
Get the Saxon Configuration
|
FeedMaker |
getFeedMaker(Expression expression,
int arg)
Get a FeedMaker, a factory class that creates a Feed to evaluate this expression
in streaming mode.
|
WatchMaker |
getWatchMaker(Expression expression,
List<String> reasonsForFailure)
Get a WatchMaker, a factory class that creates a Watch to evaluate this expression
in streaming mode.
|
static StreamingAdjunct |
makeStreamingAdjunct(Expression exp,
Configuration config)
Make a streaming adjunct for a particular expression.
|
void |
setConfiguration(Configuration config)
Set the Saxon Configuration
|
public void setConfiguration(Configuration config)
config
- the Configurationpublic Configuration getConfiguration()
public WatchMaker getWatchMaker(Expression expression, List<String> reasonsForFailure) throws XPathException
Expression.WATCH_METHOD
expression
- the expression to be evaluated in streaming modereasonsForFailure
- if non-null, this is a list supplied by the caller which will be populated
by the callee with one or more messages indicating why it was not possible to allocate a WatchMaker.
Normally if the list is non-empty on return, the return value from the method will be null.XPathException
- in the event of a failurepublic FeedMaker getFeedMaker(Expression expression, int arg) throws XPathException
expression
- the expression to be evaluated in streaming modearg
- identifies the argument with respect to which the expression is to be inverted:
usually 0 to indicate the first argument is the value that is streamed. Argument numbering
is the same as the sequence of arguments/operands returned by the method Expression.iterateSubExpressions()
XPathException
- in the event of a failurepublic static StreamingAdjunct makeStreamingAdjunct(Expression exp, Configuration config)
This would normally be a method on the class Expression; the only reason it isn't is because this code is specific to commercial editions of Saxon.
exp
- the expression to be compiledconfig
- the Saxon ConfigurationCopyright (c) 2004-2013 Saxonica Limited. All rights reserved.