1. // $Id: XPathVariableResolver.java,v 1.6 2003/12/08 04:40:47 jsuttor Exp $
  2. /*
  3. * @(#)XPathVariableResolver.java 1.5 04/07/26
  4. *
  5. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  6. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  7. */
  8. package javax.xml.xpath;
  9. import javax.xml.namespace.QName;
  10. /**
  11. * <p><code>XPathVariableResolver</code> provides access to the set of user defined XPath variables.</p>
  12. *
  13. * <p>The <code>XPathVariableResolver</code> and the XPath evaluator must adhere to a contract that
  14. * cannot be directly enforced by the API. Although variables may be mutable,
  15. * that is, an application may wish to evaluate the same XPath expression more
  16. * than once with different variable values, in the course of evaluating any
  17. * single XPath expression, a variable's value <strong><em>must</em></strong> be immutable.</p>
  18. *
  19. * @author <a href="mailto:Norman.Walsh@Sun.com">Norman Walsh</a>
  20. * @author <a href="mailto:Jeff.Suttor@Sun.com">Jeff Suttor</a>
  21. * @version $Revision: 1.6 $, $Date: 2003/12/08 04:40:47 $
  22. * @since 1.5
  23. */
  24. public interface XPathVariableResolver {
  25. /**
  26. * <p>Find a variable in the set of available variables.</p>
  27. *
  28. * <p>If <code>variableName</code> is <code>null</code>, then a <code>NullPointerException</code> is thrown.</p>
  29. *
  30. * @param variableName The <code>QName</code> of the variable name.
  31. *
  32. * @return The variables value, or <code>null</code> if no variable named <code>variableName</code>
  33. * exists. The value returned must be of a type appropriate for the underlying object model.
  34. *
  35. * @throws NullPointerException If <code>variableName</code> is <code>null</code>.
  36. */
  37. public Object resolveVariable(QName variableName);
  38. }