Interface PathExpression
- All Superinterfaces:
Immutable
- All Known Implementing Classes:
AbstractPathExpression
An expression as defined in RFC7950 Section 9.9.2,
i.e. the argument of a
path
statement.
Semantically a PathExpression
is similar to a YangXPathExpression
with guarantees around what
subexpressions it can contain:
- the root expression must be a
YangLocationPath
- it can contain steps only along
YangXPathAxis.CHILD
andYangXPathAxis.PARENT
axis - all steps along
YangXPathAxis.CHILD
axis areYangLocationPath.QNameStep
- the only function invocation is
YangFunction.CURRENT
- only
YangBinaryOperator.EQUALS
is allowed - no literals nor numbers are allowed
- all qualified node identifiers must me resolved
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
Steps of a PathExpression which is a combination ofderef()
function call and a relative path, corresponding to Errata 5617.static final class
Steps of a PathExpression which is a LocationPath, corresponding to RFC7950 base specification.static class
Abstract base class for expressing steps of a PathExpression. -
Method Summary
Modifier and TypeMethodDescriptionReturns the path expression formatted string as is defined in model.getSteps()
Return the path of this expression, which can either be aYangLocationPath
(compliant to RFC7950) or aYangPathExpr
with filter being an invocation ofYangFunction.DEREF
.default boolean
Returnstrue
if the XPapth starts in root of YANG model, otherwise returnsfalse
.
-
Method Details
-
getOriginalString
String getOriginalString()Returns the path expression formatted string as is defined in model. For example:/prefix:container/prefix:container::cond[when()=foo]/prefix:leaf
- Returns:
- the path expression formatted string as is defined in model.
-
getSteps
PathExpression.Steps getSteps()Return the path of this expression, which can either be aYangLocationPath
(compliant to RFC7950) or aYangPathExpr
with filter being an invocation ofYangFunction.DEREF
.- Returns:
- The path's steps
- Throws:
UnsupportedOperationException
- if the implementation has not parsed the string. Implementations are strongly encouraged to perform proper parsing.
-
isAbsolute
default boolean isAbsolute()Returnstrue
if the XPapth starts in root of YANG model, otherwise returnsfalse
.- Returns:
true
if the XPapth starts in root of YANG model, otherwise returnsfalse
-