KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > saxon > expr > MappingFunction


1 package net.sf.saxon.expr;
2 import net.sf.saxon.om.Item;
3 import net.sf.saxon.trans.XPathException;
4
5 /**
6 * MappingFunction is an interface that must be satisfied by an object passed to a
7 * MappingIterator. It represents an object which, given an Item, can return a
8 * SequenceIterator that delivers a sequence of zero or more Items.
9 */

10
11 public interface MappingFunction {
12
13     /**
14     * Map one item to a sequence.
15     * @param item The item to be mapped.
16     * If context is supplied, this must be the same as context.currentItem().
17     * @param context The processing context. Some mapping functions use this because they require
18     * context information. Some mapping functions modify the context by maintaining the context item
19     * and position. In other cases, the context may be null.
20     * @return either (a) a SequenceIterator over the sequence of items that the supplied input
21     * item maps to, or (b) an Item if it maps to a single item, or (c) null if it maps to an empty
22     * sequence.
23     */

24
25     public Object JavaDoc map(Item item, XPathContext context) throws XPathException;
26
27 }
28
29 //
30
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
31
// you may not use this file except in compliance with the License. You may obtain a copy of the
32
// License at http://www.mozilla.org/MPL/
33
//
34
// Software distributed under the License is distributed on an "AS IS" basis,
35
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
36
// See the License for the specific language governing rights and limitations under the License.
37
//
38
// The Original Code is: all this file.
39
//
40
// The Initial Developer of the Original Code is Michael H. Kay
41
//
42
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
43
//
44
// Contributor(s): none.
45
//
46
Popular Tags