com.saxonica.stream.adjunct

## Class ForEachAdjunct

- java.lang.Object
- - com.saxonica.stream.adjunct.StreamingAdjunct
  - - com.saxonica.stream.adjunct.ForEachAdjunct

-     public class ForEachAdjunct
      extends StreamingAdjunct

  Compile an xsl:for-each instruction to streaming code. Also handles a path expression compiled as a SlashExpression, that is, one where the right-hand side selects atomic values.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ForEachAdjunct()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `FeedMaker` | `getFeedMaker(Expression expr, int arg)` Get a FeedMaker, a factory class that creates a Feed to evaluate this expression in streaming mode.
    `static int` | `getStreamability(ContextSwitchingExpression expression, int syntacticContext, boolean allowExtensions, List<String> reasons)`
    `WatchMaker` | `getWatchMaker(Expression expression, List<String> reasonsForFailure)` Get a WatchMaker, a factory class that creates a Watch to evaluate this expression in streaming mode.

    - ### Methods inherited from class com.saxonica.stream.adjunct.StreamingAdjunct

      `getConfiguration, makeStreamingAdjunct, setConfiguration`

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

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

- - ### Constructor Detail

    - #### ForEachAdjunct

          public ForEachAdjunct()

  - ### Method Detail

    - #### getWatchMaker

          public WatchMaker getWatchMaker(Expression expression,
                                 List<String> reasonsForFailure)
                                   throws XPathException

      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 value `Expression.WATCH_METHOD`
      Overrides:
        `getWatchMaker` in class `StreamingAdjunct`
      Parameters:
        `expression` - the expression to be evaluated in streaming mode
        `reasonsForFailure` - 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.
      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

    - #### getFeedMaker

          public FeedMaker getFeedMaker(Expression expr,
                               int arg)
                                 throws XPathException

      Description copied from class: `StreamingAdjunct`
      Get a FeedMaker, a factory class that creates a Feed to evaluate this expression in streaming mode.
      Overrides:
        `getFeedMaker` in class `StreamingAdjunct`
      Parameters:
        `expr` - the expression to be evaluated in streaming mode
        `arg` - 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()`
      Returns:
        a FeedMaker 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

    - #### getStreamability

          public static int getStreamability(ContextSwitchingExpression expression,
                             int syntacticContext,
                             boolean allowExtensions,
                             List<String> reasons)

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