Stay organized with collections
Save and categorize content based on your preferences.
XPathVariableResolver
public
interface
XPathVariableResolver
javax.xml.xpath.XPathVariableResolver
|
XPathVariableResolver
provides access to the set of user defined XPath variables.
The XPathVariableResolver
and the XPath evaluator must adhere to a contract that
cannot be directly enforced by the API. Although variables may be mutable,
that is, an application may wish to evaluate the same XPath expression more
than once with different variable values, in the course of evaluating any
single XPath expression, a variable's value must be immutable.
Summary
Public methods
resolveVariable
public abstract Object resolveVariable (QName variableName)
Find a variable in the set of available variables.
If variableName
is null
, then a NullPointerException
is thrown.
Parameters |
variableName |
QName : The QName of the variable name. |
Returns |
Object |
The variables value, or null if no variable named variableName
exists. The value returned must be of a type appropriate for the underlying object model. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# XPathVariableResolver\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\nXPathVariableResolver\n=====================\n\n\n`\npublic\n\n\ninterface\nXPathVariableResolver\n`\n\n\n`\n\n\n`\n\n|---------------------------------------|\n| javax.xml.xpath.XPathVariableResolver |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\n`XPathVariableResolver` provides access to the set of user defined XPath variables.\n\nThe `XPathVariableResolver` and the XPath evaluator must adhere to a contract that\ncannot be directly enforced by the API. Although variables may be mutable,\nthat is, an application may wish to evaluate the same XPath expression more\nthan once with different variable values, in the course of evaluating any\nsingle XPath expression, a variable's value ***must*** be immutable.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract `[Object](/reference/java/lang/Object) | ` `[resolveVariable](/reference/javax/xml/xpath/XPathVariableResolver#resolveVariable(javax.xml.namespace.QName))`(`[QName](/reference/javax/xml/namespace/QName)` variableName) ` \u003cbr /\u003e Find a variable in the set of available variables. |\n\nPublic methods\n--------------\n\n### resolveVariable\n\nAdded in [API level 8](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract Object resolveVariable (QName variableName)\n```\n\n\u003cbr /\u003e\n\nFind a variable in the set of available variables.\n\nIf `variableName` is `null`, then a `NullPointerException` is thrown.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------------|---------------------------------------------------|\n| `variableName` | `QName`: The `QName` of the variable name. \u003cbr /\u003e |\n\n| Returns ||\n|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Object](/reference/java/lang/Object) | The variables value, or `null` if no variable named `variableName` exists. The value returned must be of a type appropriate for the underlying object model. \u003cbr /\u003e |\n\n| Throws ||\n|-------------------------------------------------------------------|------------------------------|\n| [NullPointerException](/reference/java/lang/NullPointerException) | If `variableName` is `null`. |"]]