com.saxonica.stream
Class StreamingPatternMaker

java.lang.Object
  extended by com.saxonica.stream.StreamingPatternMaker

public class StreamingPatternMaker
extends Object

Factory class to make a streaming pattern from an expression. This is a variant of the class PatternMaker which handles the special rules for the streaming case.


Constructor Summary
StreamingPatternMaker()
           
 
Method Summary
static Pattern fromExpression(Expression expression, Configuration config)
          Static factory method to make a pattern by converting an expression.
static Pattern makeStreamingPattern(Expression expression, Configuration config, List<String> reasonForFailure)
          Convert an expression that is capable of being evaluated as a filter on an XML event stream into a Pattern object which is able to act as the filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamingPatternMaker

public StreamingPatternMaker()
Method Detail

fromExpression

public static Pattern fromExpression(Expression expression,
                                     Configuration config)
                              throws XPathException
Static factory method to make a pattern by converting an expression. The supplied expression is the equivalent expression to the pattern, in the sense that it takes the same syntactic form.

This is a variant of the method PatternMaker.fromExpression(net.sf.saxon.expr.Expression,net.sf.saxon.Configuration,boolean), and differs in that it creates a pattern suitable for streaming evaluation.

Note that this method does NOT check all the rules for XSLT patterns; it deliberately allows a (slightly) wider class of expressions to be converted than XSLT allows.

The expression root() at the start of the expression has a special meaning: it refers to the root of the subtree in which the pattern must match, which can be supplied at run-time during pattern matching. This is used for patterns that represent streamable path expressions.

Parameters:
expression - the expression to be converted
config - the Saxon configuration
Throws:
XPathException - if the expression cannot be converted

makeStreamingPattern

public static Pattern makeStreamingPattern(Expression expression,
                                           Configuration config,
                                           List<String> reasonForFailure)
Convert an expression that is capable of being evaluated as a filter on an XML event stream into a Pattern object which is able to act as the filter

Parameters:
expression - the expression to be converted
config - the Saxon configurtaion
reasonForFailure - a list which will be populated with messages giving reasons why the expression cannot be converted
Returns:
the Pattern object if conversion succeeds; otherwise null


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