KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > xml > xpath > XPathFunctionResolver


1 // $Id: XPathFunctionResolver.java,v 1.7 2004/04/01 16:07:17 ndw Exp $
2

3 /*
4  * @(#)XPathFunctionResolver.java 1.6 04/07/26
5  *
6  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
7  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
8  */

9
10 package javax.xml.xpath;
11
12 import javax.xml.namespace.QName JavaDoc;
13
14 /**
15  * <p><code>XPathFunctionResolver</code> provides access to the set of user defined <code>XPathFunction</code>s.</p>
16  *
17  * <p>XPath functions are resolved by name and arity.
18  * The resolver is not needed for XPath built-in functions and the resolver
19  * <strong><em>cannot</em></strong> be used to override those functions.</p>
20  *
21  * <p>In particular, the resolver is only called for functions in an another
22  * namespace (functions with an explicit prefix). This means that you cannot
23  * use the <code>XPathFunctionResolver</code> to implement specifications
24  * like <a HREF="http://www.w3.org/TR/xmldsig-core/">XML-Signature Syntax
25  * and Processing</a> which extend the function library of XPath 1.0 in the
26  * same namespace. This is a consequence of the design of the resolver.</p>
27  *
28  * <p>If you wish to implement additional built-in functions, you will have to
29  * extend the underlying implementation directly.</p>
30  *
31  * @author <a HREF="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
32  * @author <a HREF="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
33  * @version $Revision: 1.7 $, $Date: 2004/04/01 16:07:17 $
34  * @see <a HREF="http://www.w3.org/TR/xpath#corelib">XML Path Language (XPath) Version 1.0, Core Function Library</a>
35  * @since 1.5
36  */

37 public interface XPathFunctionResolver {
38   /**
39    * <p>Find a function in the set of available functions.</p>
40    *
41    * <p>If <code>functionName</code> or <code>arity</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
42    *
43    * @param functionName The function name.
44    * @param arity The number of arguments that the returned function must accept.
45    *
46    * @return The function or <code>null</code> if no function named <code>functionName</code> with <code>arity</code> arguments exists.
47    *
48    * @throws NullPointerException If <code>functionName</code> or <code>arity</code> is <code>null</code>.
49    */

50   public XPathFunction JavaDoc resolveFunction(QName JavaDoc functionName, int arity);
51 }
52
Popular Tags