Package net.sf.saxon.expr

## Class ItemTypeCheckingFunction

- java.lang.Object
- - net.sf.saxon.expr.ItemTypeCheckingFunction

- All Implemented Interfaces:
    `ItemMappingFunction`

      public class ItemTypeCheckingFunction
      extends java.lang.Object
      implements ItemMappingFunction

  A mapping function for use in conjunction with an `ItemMappingIterator` that checks that all the items in a sequence are instances of a given item type

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ItemTypeCheckingFunction​(ItemType requiredItemType, RoleDiagnostic role, Expression failingExpression, Configuration config)` | Create the type-checking function
    `ItemTypeCheckingFunction​(ItemType requiredItemType, RoleDiagnostic role, Location locator, Configuration config)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Item` | `mapItem​(Item item)` | Map one item to another item.

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

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

- - ### Constructor Detail

    - #### ItemTypeCheckingFunction

          public ItemTypeCheckingFunction​(ItemType requiredItemType,
                                          RoleDiagnostic role,
                                          Expression failingExpression,
                                          Configuration config)

      Create the type-checking function
      Parameters:
        `requiredItemType` - the item type that all items in the sequence must conform to
        `role` - information for error messages
        `failingExpression` - the location of the expression for error messages
        `config` - the Saxon configuration

    - #### ItemTypeCheckingFunction

          public ItemTypeCheckingFunction​(ItemType requiredItemType,
                                          RoleDiagnostic role,
                                          Location locator,
                                          Configuration config)

  - ### Method Detail

    - #### mapItem

          public 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