Stay organized with collections
Save and categorize content based on your preferences.
XPathVariableResolver
interface 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 |
abstract Any! |
Find a variable in the set of available variables.
|
Public methods
resolveVariable
abstract fun resolveVariable(variableName: QName!): Any!
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. |
Return |
Any! |
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. |
Exceptions |
java.lang.NullPointerException |
If variableName is null . |
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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nXPathVariableResolver\n=====================\n\n```\ninterface XPathVariableResolver\n```\n\n|--------------------------------------------|\n| [javax.xml.xpath.XPathVariableResolver](#) |\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 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.\n\nSummary\n-------\n\n| Public methods ||\n|--------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | [resolveVariable](#resolveVariable(javax.xml.namespace.QName))`(`variableName:` `[QName](../namespace/QName.html#)!`)` Find a variable in the set of available variables. |\n\nPublic methods\n--------------\n\n### resolveVariable\n\nAdded in [API level 8](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun resolveVariable(variableName: QName!): Any!\n```\n\nFind a variable in the set of available variables.\n\nIf `variableName` is `null`, then a `NullPointerException` is thrown.\n\n| Parameters ||\n|----------------|-----------------------------------------------------------------------|\n| `variableName` | [QName](../namespace/QName.html#)!: The `QName` of the variable name. |\n\n| Return ||\n|-----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | 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. |\n\n| Exceptions ||\n|----------------------------------|------------------------------|\n| `java.lang.NullPointerException` | If `variableName` is `null`. |"]]