Add OnDemandSchemaTreeStorageNode 63/93463/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 29 Oct 2020 11:55:55 +0000 (12:55 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 29 Oct 2020 11:57:01 +0000 (12:57 +0100)
commit5be3107a8f7daca1e3584bace9a684e21315df70
tree3a422705344fe63902c5d1d487d078569b0023e1
parent83393e1bcd170c194961e97c14a46e30d85fbc22
Add OnDemandSchemaTreeStorageNode

In order to correctly implement schema dependencies, we need to
invoke a callback from namespace prerequisites back to
StatementContextBase and its subclasses.

The conduit here is NamespaceBehavior.getFrom(), which is invoked
with a namespace key. For ChildSchemaNodeNamespace this ends up
the QName matching the argument the corresponding
SchemaTreeEffectiveStatement will end up having.

Introduce OnDemandSchemaTreeStorageNode, which acts as an extension
to normal NamespaceStorageNode behavior -- it allows an
implementation to supply a QName-based child statement to be
returned.

Since StatementContextBase is a NamespaceStorageNode, its subclasses
can now additionally implement this interface to receive the
callback.

JIRA: YANGTOOLS-784
Change-Id: I0e6f621eb39b341af61005b2334174e814c18875
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/namespace/ChildSchemaNodeNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/NamespaceBehaviour.java