Package com.saxonica.ee.bytecode.map

## Class ForItemMappingAction

- java.lang.Object
- - com.saxonica.ee.bytecode.map.ForItemMappingAction

- All Implemented Interfaces:
    `ItemMappingFunction`

      public abstract class ForItemMappingAction
      extends java.lang.Object
      implements ItemMappingFunction

  The ForItemMappingAction supports compilation of a ForExpression. It represents the action to be taken for each item in the source sequence. It acts as the MappingFunction for the mapping iterator. The map() method is generated in the subclass, and performs the "action" part of the for expression, being called once per iteration, and returning an iterator over the results.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected XPathContext` | `context` |

  - ### Constructor Summary

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

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `abstract Item` | `mapItem​(Item item)` | Map one item to another item.
    `void` | `setContext​(XPathContext context)` |

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

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

- - ### Field Detail

    - #### context

          protected XPathContext context

  - ### Constructor Detail

    - #### ForItemMappingAction

          public ForItemMappingAction()

  - ### Method Detail

    - #### setContext

          public void setContext​(XPathContext context)

    - #### mapItem

          public abstract Item mapItem​(Item item)
                                throws XPathException

      Description copied from interface: `ItemMappingFunction`
      Map one item to another item.
      Specified by:
        `mapItem` in interface `ItemMappingFunction`
      Parameters:
        `item` - The input item to be mapped.
      Returns:
        either the output item, or null.
      Throws:
        `XPathException` - if a dynamic error occurs