Add DataTreeAwareEffectiveStatement 07/72907/18
authorRobert Varga <robert.varga@pantheon.tech>
Tue, 27 Feb 2018 08:25:29 +0000 (09:25 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Jun 2018 13:34:47 +0000 (15:34 +0200)
commit29919477f00777a6e8b42560af159438d54847f4
tree6171fe507ab7ee2e5f361a88af9aa583b712169b
parenteae57f9cd4605c5b13a24d843c0e4278d8b5deb2
Add DataTreeAwareEffectiveStatement

YANG defines two distinct ways to look at a YANG model:
- schema tree: The definition hierarchy specified within a module.
- data tree: An instantiated tree of any data modeled with YANG,
             e.g., configuration data, state data, combined
             configuration and state data, RPC or action input,
             RPC or action output, or notification.

This means that there really are two notions of 'a child node',
based on schema tree, or based on data tree. The data tree is
a strict subset of schema tree. The layout of the data tree is
such that it does not include RPCs, actions nor notifications --
addressing data tree nodes encapsulated in these requires
first reaching the encapsulation point via schema tree walk.

This patch introduces DataTreeAwareEffectiveStatement
and its companion DataTreeEffectiveStatement, updating extant
statements to support it.

Construction of this namespace has a side-effect of finding
duplicate data nodes within each level of hierarchy, thus fixing
YANGTOOLS-883.

JIRA: YANGTOOLS-853
JIRA: YANGTOOLS-883
Change-Id: Id02bb2557845000fe7fa90d1bf56c8425cce24fb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Jie Han <han.jie@zte.com.cn>
19 files changed:
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ActionEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/AnydataEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/AnyxmlEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ContainerEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/DataTreeAwareEffectiveStatement.java [new file with mode: 0644]
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/DataTreeEffectiveStatement.java [new file with mode: 0644]
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/InputEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/LeafListEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ListEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/ModuleEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/NotificationEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/OutputEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/RpcEffectiveStatement.java
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/stmt/SchemaTreeAwareEffectiveStatement.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/AbstractSchemaEffectiveDocumentedNode.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/stmt/NameCollisionWithinCaseTest.java [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/name-collision-within-case/bar.yang [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/name-collision-within-case/baz.yang [new file with mode: 0644]
yang/yang-parser-rfc7950/src/test/resources/bugs/name-collision-within-case/foo.yang [new file with mode: 0644]