| 1 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 2 | // Copyright (c) 2018 Saxonica Limited. |
| 3 | // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. |
| 4 | // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 5 | // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. |
| 6 | //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 7 | |
| 8 | package net.sf.saxon.expr; |
| 9 | |
| 10 | import net.sf.saxon.om.Item; |
| 11 | import net.sf.saxon.trans.XPathException; |
| 12 | |
| 13 | /** |
| 14 | * ItemMappingFunction is an interface that must be satisfied by an object passed to a |
| 15 | * ItemMappingIterator. It represents an object which, given an Item, can return either |
| 16 | * another Item, or null. |
| 17 | * <p>The interface is generic, paramterized by F (from) the input item type, and T (to), |
| 18 | * the output item type</p> |
| 19 | */ |
| 20 | |
| 21 | public interface ItemMappingFunction<F extends Item<?>, T extends Item<?>> { |
| 22 | |
| 23 | /** |
| 24 | * Map one item to another item. |
| 25 | * |
| 26 | * @param item The input item to be mapped. |
| 27 | * @return either the output item, or null. |
| 28 | * @throws XPathException if a dynamic error occurs |
| 29 | */ |
| 30 | |
| 31 | /*@Nullable*/ |
| 32 | T mapItem(F item) throws XPathException; |
| 33 | |
| 34 | } |
| 35 |