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: XPathVariableResolver.java 446598 2006-09-15 12:55:40Z jeremias $
18
19package javax.xml.xpath;
20
21import javax.xml.namespace.QName;
22
23/**
24 * <p><code>XPathVariableResolver</code> provides access to the set of user defined XPath variables.</p>
25 *
26 * <p>The <code>XPathVariableResolver</code> and the XPath evaluator must adhere to a contract that
27 * cannot be directly enforced by the API.  Although variables may be mutable,
28 * that is, an application may wish to evaluate the same XPath expression more
29 * than once with different variable values, in the course of evaluating any
30 * single XPath expression, a variable's value <strong><em>must</em></strong> be immutable.</p>
31 *
32 * @author  <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
33 * @author  <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
34 * @version $Revision: 446598 $, $Date: 2006-09-15 05:55:40 -0700 (Fri, 15 Sep 2006) $
35 * @since 1.5
36 */
37public interface XPathVariableResolver {
38  /**
39   * <p>Find a variable in the set of available variables.</p>
40   *
41   * <p>If <code>variableName</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
42   *
43   * @param variableName The <code>QName</code> of the variable name.
44   *
45   * @return The variables value, or <code>null</code> if no variable named <code>variableName</code>
46   *   exists.  The value returned must be of a type appropriate for the underlying object model.
47   *
48   * @throws NullPointerException If <code>variableName</code> is <code>null</code>.
49   */
50  public Object resolveVariable(QName variableName);
51}
52