Interface YangXPathExpression
- All Superinterfaces:
Immutable
- All Known Subinterfaces:
YangXPathExpression.QualifiedBound
,YangXPathExpression.UnqualifiedBound
An XPath expression. This interface defines a parsed representation of an XPath defined in a YANG context, as
specified in RFC7950, Section 6.4.
The specification along with rules for path
statement evaluation rules end up defining four incremental
levels to which an XPath expression can be bound:
- Unbound Expressions, which is a essentially a parse tree. No namespace binding has been performed, i.e. all
node identifiers are in
UnresolvedQName.Qualified
orUnresolvedQName.Unqualified
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. - Qualified-bound Expressions, where all
UnresolvedQName.Qualified
s are resolved and bound toQName
s, butUnresolvedQName.Unqualified
s are still present. This level corresponds to how far a YANG parser can interpret XPath expressions defined intypedef
statements and statements which are not fully instantiated, i.e. are descendants of agrouping
statement. - Namespace-bound Expressions, where all node identifier references are resolved to
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 anaction
/@{code rpc}/notification
or similar context. - Context-bound Expressions, where the expression is bound to a {code context node}, i.e.
current()
function result is know. This API does not handle this state, as it is inherently bound to a particular data object model.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A Qualified-bound expression.static interface
An Unqualified-bound expression. -
Method Summary
Modifier and TypeMethodDescriptionReturn theYangXPathMathMode
used in this expression.Return the rootYangExpr
.Return the minimum YangVersion runtime required to interpret this expression.Attempt to interpret aYangLiteralExpr
referenced by this expression as aQName
.
-
Method Details
-
getRootExpr
YangExpr getRootExpr()Return the rootYangExpr
.- Returns:
- Root expression.
-
getMathMode
YangXPathMathMode getMathMode()Return theYangXPathMathMode
used in this expression. AllYangNumberExpr
objects used by this expression are expected to be handled by this mode'sYangXPathMathSupport
.- Returns:
- YangXPathMathMode
-
getYangVersion
YangVersion getYangVersion()Return the minimum YangVersion runtime required to interpret this expression.- Returns:
- YangVersion runtime version compatibility level required to accurately interpret this expression.
-
interpretAsQName
Attempt to interpret aYangLiteralExpr
referenced by this expression as aQName
. This method is required to perform late value binding of the expression when the literal needs to be interpreted as a reference to anidentity
.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.
- Parameters:
expr
- Literal to be reinterpreted- Returns:
- YangQNameExpr result of interpretation
- Throws:
XPathExpressionException
- when the literal cannot be interpreted as a QName
-
interpretAsInstanceIdentifier
YangLocationPath interpretAsInstanceIdentifier(YangLiteralExpr expr) throws XPathExpressionException - Throws:
XPathExpressionException
-