net.sf.saxon.expr

## Class ItemTypeCheckingFunction<T extends Item>

- java.lang.Object
- - net.sf.saxon.expr.ItemTypeCheckingFunction<T>

- Type Parameters:
    `T` - Defines a subtype of item to be checked
  All Implemented Interfaces:
    ItemMappingFunction<T,T>

      public class ItemTypeCheckingFunction<T extends Item>
      extends Object
      implements ItemMappingFunction<T,T>

  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 and Description
    `ItemTypeCheckingFunction(ItemType requiredItemType, RoleLocator role, SourceLocator locator, Configuration config)` Create the type-checking function

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `mapItem(T 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,
                                  RoleLocator role,
                                  SourceLocator locator,
                                  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
        `locator` - the location of the expression for error messages
        `config` - the Saxon configuration

  - ### Method Detail

    - #### mapItem

          public T mapItem(T item)
                                 throws XPathException

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

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