@Beta public interface YangXPathExpression extends Immutable
The specification along with rules for path
statement evaluation rules end up defining four incremental
levels to which an XPath expression can be bound:
QualifiedQName
or UnqualifiedQName
form. This level is typically not used
when dealing with YANG models directly, but can be useful for validating a String conforms to XPath syntax.
QualifiedQName
s are resolved and bound to QName
s, but
UnqualifiedQName
s are still present. This level corresponds to how far a YANG parser can interpret XPath
expressions defined in typedef
statements and statements which are not fully instantiated, i.e. are
descendants of a grouping
statement.
QName
s. This level
corresponds to how far a YANG parser can interpret XPath expressions at their place of instantiation, either in
the data tree or an action
/@{code rpc}/notification
or similar context.
current()
function result is know. This API does not handle this state, as it is inherently bound to a particular data
object model.
Modifier and Type | Interface and Description |
---|---|
static interface |
YangXPathExpression.QualifiedBound
A Qualified-bound expression.
|
static interface |
YangXPathExpression.UnqualifiedBound |
Modifier and Type | Method and Description |
---|---|
YangXPathMathMode |
getMathMode()
Return the
YangXPathMathMode used in this expression. |
YangExpr |
getRootExpr()
Return the root
YangExpr . |
YangLocationPath |
interpretAsInstanceIdentifier(YangLiteralExpr expr) |
YangQNameExpr |
interpretAsQName(YangLiteralExpr expr)
Attempt to interpret a
YangLiteralExpr referenced by this expression as a QName . |
YangXPathMathMode getMathMode()
YangXPathMathMode
used in this expression. All YangNumberExpr
objects used by this
expression are expected to be handled by this mode's YangXPathMathSupport
.YangQNameExpr interpretAsQName(YangLiteralExpr expr) throws XPathExpressionException
YangLiteralExpr
referenced by this expression as a QName
. This method
is required to perform late value binding of the expression when the literal needs to be interpreted as
a reference to an identity
.
The syntax of expr is required to conform to
XML QName format, as further restricted by
YANG identityref
Lexical Representation.
Unfortunately we do not know when a literal will need to be interpreted in this way, as that can only be known at evaluation.
expr
- Literal to be reinterpretedXPathExpressionException
- when the literal cannot be interpreted as a QNameYangLocationPath interpretAsInstanceIdentifier(YangLiteralExpr expr) throws XPathExpressionException
XPathExpressionException
Copyright © 2019 OpenDaylight. All rights reserved.