1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 // $Id: XPathFunction.java 446598 2006-09-15 12:55:40Z jeremias $
18 
19 package javax.xml.xpath;
20 
21 import java.util.List;
22 
23 /**
24  * <p><code>XPathFunction</code> provides access to XPath functions.</p>
25  *
26  * <p>Functions are identified by QName and arity in XPath.</p>
27  *
28  * @author  <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
29  * @author  <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
30  * @version $Revision: 446598 $, $Date: 2006-09-15 05:55:40 -0700 (Fri, 15 Sep 2006) $
31  * @since 1.5
32  */
33 public interface XPathFunction {
34   /**
35    * <p>Evaluate the function with the specified arguments.</p>
36    *
37    * <p>To the greatest extent possible, side-effects should be avoided in the
38    * definition of extension functions. The implementation evaluating an
39    * XPath expression is under no obligation to call extension functions in
40    * any particular order or any particular number of times.</p>
41    *
42    * @param args The arguments, <code>null</code> is a valid value.
43    *
44    * @return The result of evaluating the <code>XPath</code> function as an <code>Object</code>.
45    *
46    * @throws XPathFunctionException If <code>args</code> cannot be evaluated with this <code>XPath</code> function.
47    */
evaluate(List args)48   public Object evaluate(List args)
49     throws XPathFunctionException;
50 }
51 
52