Package com.saxonica.ee.stream.adjunct

## Class ForEachAdjunct

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

- All Implemented Interfaces:
    `FeedMaker`
  Direct Known Subclasses:
    `ForEachGroupAdjunct`

      public class ForEachAdjunct
      extends TransmissionAdjunct
      implements FeedMaker

  Compile an xsl:for-each instruction to streaming code. Also handles a path expression (SlashExpression).

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ForEachAdjunct()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `PostureAndSweep` | `computeStreamability​(ContextItemStaticInfoEE contextInfo, java.util.List<java.lang.String> reasons)` | Compute the posture and sweep of this expression as defined in the W3C streamability specifications.
    `protected Inversion` | `getActionInversion​(boolean forGrouping)` |
    `static PostureAndSweep` | `getStreamability​(ContextSwitchingExpression expression, ContextItemStaticInfoEE contextInfo, java.util.List<java.lang.String> reasons)` |
    `WatchMaker` | `getWatchMaker​(boolean forGrouping)` | Get a WatchMaker, a factory class that creates a Watch to evaluate this expression in streaming mode.
    `ItemFeed` | `makeItemFeed​(WatchManager watchManager, ItemFeed out, XPathContext context)` |
    `void` | `setExpression​(Expression expression)` | Set the expression being processed by this StreamingAdjunct
    `Pattern` | `toStreamingPattern​(Configuration config)` | Convert this expression to a streaming pattern (a pattern used internally to match nodes during push processing of an event stream)

    - ### Methods inherited from class com.saxonica.ee.stream.adjunct.TransmissionAdjunct

      `makeTransmissionFlow`

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

      `findConsumingArg, getConfiguration, getDefaultFeedMaker, getExpression, getFeedMaker, 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

    - #### setExpression

          public void setExpression​(Expression expression)

      Set the expression being processed by this StreamingAdjunct
      Overrides:
        `setExpression` in class `StreamingAdjunct`
      Parameters:
        `expression` - the expression being processed

    - #### toStreamingPattern

          public Pattern toStreamingPattern​(Configuration config)

      Convert this expression to a streaming pattern (a pattern used internally to match nodes during push processing of an event stream)
      Overrides:
        `toStreamingPattern` in class `StreamingAdjunct`
      Parameters:
        `config` - the Saxon configuration
      Returns:
        the equivalent pattern if conversion succeeds; otherwise null

    - #### getActionInversion

          protected Inversion getActionInversion​(boolean forGrouping)
                                          throws XPathException

      Throws:
        `XPathException`

    - #### getWatchMaker

          public WatchMaker getWatchMaker​(boolean forGrouping)
                                   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 `TransmissionAdjunct`
      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

    - #### makeItemFeed

          public ItemFeed makeItemFeed​(WatchManager watchManager,
                                       ItemFeed out,
                                       XPathContext context)
                                throws XPathException

      Specified by:
        `makeItemFeed` in interface `FeedMaker`
      Throws:
        `XPathException`

    - #### computeStreamability

          public PostureAndSweep computeStreamability​(ContextItemStaticInfoEE contextInfo,
                                                      java.util.List<java.lang.String> reasons)

      Description copied from class: `StreamingAdjunct`
      Compute the posture and sweep of this expression as defined in the W3C streamability specifications. This must be implemented in all subclasses that don't use the general streamability rules. The implementation should have the side-effect of computing the streamability of all subexpressions, recursively.
      Overrides:
        `computeStreamability` in class `StreamingAdjunct`
      Parameters:
        `contextInfo` - Information about the context item type and posture
        `reasons` - the caller may supply a list, in which case the implementation may add to this; the contents are human-readable messages explaining why the expression is not streamable.
      Returns:
        the posture and sweep of the expression

    - #### getStreamability

          public static PostureAndSweep getStreamability​(ContextSwitchingExpression expression,
                                                         ContextItemStaticInfoEE contextInfo,
                                                         java.util.List<java.lang.String> reasons)