import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.NamespaceStorageNode;
import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.Registry;
import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.StorageNodeType;
+import org.opendaylight.yangtools.yang.parser.spi.meta.RootStmtContext;
import org.opendaylight.yangtools.yang.parser.spi.source.IncludedModuleContext;
import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
* of this class, hence recursive lookups from them cross this class.
*/
public final class RootStatementContext<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>>
- extends AbstractResumedStatement<A, D, E> {
+ extends AbstractResumedStatement<A, D, E> implements RootStmtContext.Mutable<A, D, E> {
public static final YangVersion DEFAULT_VERSION = YangVersion.VERSION_1;
--- /dev/null
+/*
+ * Copyright (c) 2020 PANTHEON.tech, s.r.o. and others. All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ */
+package org.opendaylight.yangtools.yang.parser.spi.meta;
+
+import com.google.common.annotations.Beta;
+import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
+import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
+
+/**
+ * A marker interface for a {@link StmtContext}. Useful for operations which make assumption about the context's
+ * hierarchy.
+ *
+ * @param <A> Argument type
+ * @param <D> Declared Statement representation
+ * @param <E> Effective Statement representation
+ */
+@Beta
+public interface RootStmtContext<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>>
+ extends StmtContext<A, D, E> {
+
+ interface Mutable<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>>
+ extends StmtContext.Mutable<A, D, E>, RootStmtContext<A, D, E> {
+
+ @Override
+ RootStmtContext.Mutable<?, ?, ?> getRoot();
+ }
+}
<K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAllFromCurrentStmtCtxNamespace(Class<N> type);
- @NonNull StmtContext<?, ?, ?> getRoot();
+ @NonNull RootStmtContext<?, ?, ?> getRoot();
/**
* Return declared substatements. These are the statements which are explicitly written in the source model.
T key, U value);
@Override
- Mutable<?, ?, ?> getRoot();
+ RootStmtContext.Mutable<?, ?, ?> getRoot();
/**
* Create a child sub-statement, which is a child of this statement, inheriting all attributes from specified