import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
import org.opendaylight.yangtools.yang.parser.spi.ParserNamespaces;
-import org.opendaylight.yangtools.yang.parser.spi.SchemaTreeNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
import org.opendaylight.yangtools.yang.parser.spi.meta.MutableStatement;
import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.NamespaceStorageNode;
import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.StorageNodeType;
import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.RootStmtContext;
-import org.opendaylight.yangtools.yang.parser.spi.source.SourceParserNamespaces;
import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
* Root statement class for a YANG source. All statements defined in that YANG source are mapped underneath an instance
* 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>>
+final class RootStatementContext<A, D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>>
extends AbstractResumedStatement<A, D, E> implements RootStmtContext.Mutable<A, D, E> {
- public static final YangVersion DEFAULT_VERSION = YangVersion.VERSION_1;
+ static final YangVersion DEFAULT_VERSION = YangVersion.VERSION_1;
private static final Logger LOG = LoggerFactory.getLogger(RootStatementContext.class);
// These namespaces are well-known and not needed after the root is cleaned up
private static final Map<ParserNamespace<?, ?>, SweptNamespace> SWEPT_NAMESPACES = ImmutableMap.of(
ParserNamespaces.GROUPING, new SweptNamespace(ParserNamespaces.GROUPING),
- SchemaTreeNamespace.instance(), new SweptNamespace(SchemaTreeNamespace.instance()),
+ ParserNamespaces.schemaTree(), new SweptNamespace(ParserNamespaces.schemaTree()),
ParserNamespaces.TYPE, new SweptNamespace(ParserNamespaces.TYPE));
private final @NonNull SourceSpecificContext sourceContext;
}
@Override
- public <K, V, N extends ParserNamespace<K, V>> V putToLocalStorage(final N type, final K key, final V value) {
- if (SourceParserNamespaces.INCLUDED_MODULE.equals(type)) {
+ public <K, V> V putToLocalStorage(final ParserNamespace<K, V> type, final K key, final V value) {
+ if (ParserNamespaces.INCLUDED_MODULE.equals(type)) {
if (includedContexts.isEmpty()) {
includedContexts = new ArrayList<>(1);
}
}
@Override
- public <K, V, N extends ParserNamespace<K, V>> V getFromLocalStorage(final N type, final K key) {
+ public <K, V> V getFromLocalStorage(final ParserNamespace<K, V> type, final K key) {
return getFromLocalStorage(type, key, new HashSet<>());
}
* We need to track already checked RootStatementContexts due to possible
* circular chains of includes between submodules
*/
- private <K, V, N extends ParserNamespace<K, V>> @Nullable V getFromLocalStorage(final N type,
- final K key, final HashSet<RootStatementContext<?, ?, ?>> alreadyChecked) {
+ private <K, V> @Nullable V getFromLocalStorage(final ParserNamespace<K, V> type, final K key,
+ final HashSet<RootStatementContext<?, ?, ?>> alreadyChecked) {
final V potentialLocal = super.getFromLocalStorage(type, key);
if (potentialLocal != null) {
return potentialLocal;
}
@Override
- public <K, V, N extends ParserNamespace<K, V>> Map<K, V> getAllFromLocalStorage(final N type) {
+ public <K, V> Map<K, V> getAllFromLocalStorage(final ParserNamespace<K, V> type) {
return getAllFromLocalStorage(type, new HashSet<>());
}
* We need to track already checked RootStatementContexts due to possible
* circular chains of includes between submodules
*/
- private <K, V, N extends ParserNamespace<K, V>> @Nullable Map<K, V> getAllFromLocalStorage(final N type,
+ private <K, V> @Nullable Map<K, V> getAllFromLocalStorage(final ParserNamespace<K, V> type,
final HashSet<RootStatementContext<?, ?, ?>> alreadyChecked) {
final Map<K, V> potentialLocal = super.getAllFromLocalStorage(type);
if (potentialLocal != null) {