+ /**
+ * Interface implemented by {@link NamespaceStorageNode}s which support dynamic addition of child elements as they
+ * are requested. This means that such a node can, defer creation of child namespace storage nodes, in effect lazily
+ * expanding this namespace on an if-needed basis.
+ */
+ @Beta
+ public interface OnDemandSchemaTreeStorageNode extends NamespaceStorageNode {
+ /**
+ * Request that a new member of this node's schema tree statement be added. Implementations are required to
+ * perform lookup in their internal structure and create a child if tractable. Resulting node is expected to
+ * have been registered with local storage, so that it is accessible through
+ * {@link #getFromLocalStorage(Class, Object)}.
+ *
+ * <p>
+ * This method must not change its mind about a child's presence -- once it returns non-present, it has to be
+ * always returning non-present.
+ *
+ * <p>
+ * The results produced by this method are expected to be consistent with
+ * {@link SchemaTreeAwareEffectiveStatement#findSchemaTreeNode(QName)} and
+ * {@link SchemaTreeNamespace#getFrom(NamespaceStorageNode, QName)}.
+ *
+ * @param qname node identifier of the child being requested
+ * @return Requested child, if it is present.
+ * @throws NullPointerException in {@code qname} is null
+ */
+ <D extends DeclaredStatement<QName>, E extends EffectiveStatement<QName, D>>
+ @Nullable StmtContext<QName, D, E> requestSchemaTreeChild(QName qname);
+ }
+