Add OnDemandSchemaTreeStorageNode 30/93530/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 29 Oct 2020 11:55:55 +0000 (12:55 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 31 Oct 2020 08:04:48 +0000 (09:04 +0100)
commit02959594e02c3f68c70cca0632276ca143fcdbe4
tree8c1af8a12b1b6f62884cd48ff5ff66d6510fce34
parent888d6b36fbeafdf699c4b48abbeb42e30e7c642c
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>
(cherry picked from commit 5be3107a8f7daca1e3584bace9a684e21315df70)
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