import org.opendaylight.yangtools.yang.model.api.SchemaPath;
import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
import org.opendaylight.yangtools.yang.parser.spi.GroupingNamespace;
import org.opendaylight.yangtools.yang.parser.spi.SchemaTreeNamespace;
+import org.opendaylight.yangtools.yang.parser.spi.TypeNamespace;
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.Registry;
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.IncludedModuleContext;
import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
// These namespaces are well-known and not needed after the root is cleaned up
private static final Map<Class<?>, SweptNamespace> SWEPT_NAMESPACES = ImmutableMap.of(
GroupingNamespace.class, new SweptNamespace(GroupingNamespace.class),
- // FIXME: YANGTOOLS-1198: sweep TypeNamespace
- // TypeNamespace.class, new SweptNamespace(TypeNamespace.class),
- SchemaTreeNamespace.class, new SweptNamespace(SchemaTreeNamespace.class));
+ SchemaTreeNamespace.class, new SweptNamespace(SchemaTreeNamespace.class),
+ TypeNamespace.class, new SweptNamespace(TypeNamespace.class));
private final @NonNull SourceSpecificContext sourceContext;
private final A argument;
}
@Override
- public <K, V, N extends IdentifierNamespace<K, V>> V putToLocalStorage(final Class<N> type, final K key,
+ public <K, V, N extends ParserNamespace<K, V>> V putToLocalStorage(final Class<N> type, final K key,
final V value) {
if (IncludedModuleContext.class.isAssignableFrom(type)) {
if (includedContexts.isEmpty()) {
}
@Override
- public <K, V, N extends IdentifierNamespace<K, V>> V getFromLocalStorage(final Class<N> type, final K key) {
+ public <K, V, N extends ParserNamespace<K, V>> V getFromLocalStorage(final Class<N> 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 IdentifierNamespace<K, V>> @Nullable V getFromLocalStorage(final Class<N> type,
+ private <K, V, N extends ParserNamespace<K, V>> @Nullable V getFromLocalStorage(final Class<N> type,
final K key, final HashSet<RootStatementContext<?, ?, ?>> alreadyChecked) {
final V potentialLocal = super.getFromLocalStorage(type, key);
if (potentialLocal != null) {
}
@Override
- public <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAllFromLocalStorage(final Class<N> type) {
+ public <K, V, N extends ParserNamespace<K, V>> Map<K, V> getAllFromLocalStorage(final Class<N> 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 IdentifierNamespace<K, V>> @Nullable Map<K, V> getAllFromLocalStorage(final Class<N> type,
+ private <K, V, N extends ParserNamespace<K, V>> @Nullable Map<K, V> getAllFromLocalStorage(final Class<N> type,
final HashSet<RootStatementContext<?, ?, ?>> alreadyChecked) {
final Map<K, V> potentialLocal = super.getAllFromLocalStorage(type);
if (potentialLocal != null) {
this.rootVersion = requireNonNull(version);
}
- void addMutableStmtToSealImpl(final MutableStatement mutableStatement) {
+ /**
+ * Add mutable statement to seal. Each mutable statement must be sealed
+ * as the last step of statement parser processing.
+ *
+ * @param mutableStatement
+ * mutable statement which should be sealed
+ */
+ void addMutableStmtToSeal(final MutableStatement mutableStatement) {
sourceContext.globalContext().addMutableStmtToSeal(mutableStatement);
}
@Override
StatementContextBase<A, D, E> reparent(final StatementContextBase<?, ?, ?> newParent) {
- throw new UnsupportedOperationException("Root statement cannot be reparented to" + newParent);
+ throw new UnsupportedOperationException("Root statement cannot be reparented to " + newParent);
}
@Override