01: package net.sf.saxon.expr;
02:
03: import net.sf.saxon.om.Item;
04: import net.sf.saxon.trans.XPathException;
05:
06: /**
07: * MappingFunction is an interface that must be satisfied by an object passed to a
08: * MappingIterator. It represents an object which, given an Item, can return a
09: * SequenceIterator that delivers a sequence of zero or more Items.
10: */
11:
12: public interface MappingFunction {
13:
14: /**
15: * Map one item to a sequence.
16: * @param item The item to be mapped.
17: * If context is supplied, this must be the same as context.currentItem().
18: * @param context The processing context. Some mapping functions use this because they require
19: * context information. Some mapping functions modify the context by maintaining the context item
20: * and position. In other cases, the context may be null.
21: * @return either (a) a SequenceIterator over the sequence of items that the supplied input
22: * item maps to, or (b) an Item if it maps to a single item, or (c) null if it maps to an empty
23: * sequence.
24: */
25:
26: public Object map(Item item, XPathContext context)
27: throws XPathException;
28:
29: }
30:
31: //
32: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
33: // you may not use this file except in compliance with the License. You may obtain a copy of the
34: // License at http://www.mozilla.org/MPL/
35: //
36: // Software distributed under the License is distributed on an "AS IS" basis,
37: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
38: // See the License for the specific language governing rights and limitations under the License.
39: //
40: // The Original Code is: all this file.
41: //
42: // The Initial Developer of the Original Code is Michael H. Kay
43: //
44: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
45: //
46: // Contributor(s): none.
47: //
|