Add ParserNamespace 42/94642/4
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 15 Jan 2021 22:28:43 +0000 (23:28 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 16 Jan 2021 06:47:14 +0000 (07:47 +0100)
Parser's use of IdentifierNamespace is really mixing apples and oranges,
as parser has different needs than end users. ParserNamespace acts as
the replacement for IdentifierNamespace where parser internals are
concerned.

JIRA: YANGTOOLS-1204
Change-Id: I3710a610614526983b14289c11ad8e0664ad86a0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
50 files changed:
yang/odlext-parser-support/src/main/java/org/opendaylight/yangtools/odlext/parser/AnyxmlSchemaLocationNamespace.java
yang/rfc8040-parser-support/src/main/java/org/opendaylight/yangtools/rfc8040/parser/YangDataArgumentNamespace.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/BuildGlobalContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ModifierImpl.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/NamespaceBehaviourWithListeners.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/NamespaceStorageSupport.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ReactorStmtCtx.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/ReplicaStatementContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/RootStatementContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/SimpleNamespaceContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/SourceSpecificContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementContextBase.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/StatementDefinitionContext.java
yang/yang-parser-reactor/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/reactor/VirtualNamespaceContext.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/namespace/ModuleQNameToPrefix.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/namespace/YangNamespaceContextNamespace.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/augment/AugmentImplicitHandlingNamespace.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/import_/ImportedVersionNamespace.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/list/ConfigListWarningNamespace.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/module/QNameModuleNamespace.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/type/BaseTypeNamespace.java
yang/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/stmt/uses/SourceGroupingNamespace.java
yang/yang-parser-rfc7950/src/test/java/org/opendaylight/yangtools/yang/thirdparty/plugin/ThirdPartyNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/SchemaTreeNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/DerivedNamespaceBehaviour.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ImportedNamespaceContext.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ModelActionBuilder.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/NamespaceBehaviour.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/NamespaceStmtCtx.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ParserNamespace.java [new file with mode: 0644]
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/SemanticVersionNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementDefinitionNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StatementSupportBundle.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/StmtContext.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/BelongsToPrefixToModuleName.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ImpPrefixToNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ImportPrefixToModuleCtx.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ImportPrefixToSemVerSourceIdentifier.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/IncludedSubmoduleNameToModuleCtx.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ModuleCtxToModuleQName.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ModuleCtxToSourceIdentifier.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ModuleNameToModuleQName.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ModuleNameToNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ModuleQNameToModuleName.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/ModulesDeviatedByModules.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/PrefixToModule.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/QNameToStatementDefinition.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/source/SupportedFeaturesNamespace.java
yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/validation/ValidationBundlesNamespace.java

index 8a3721d66030a46d8d6d190cd89be01ffe61cd58..37c9fbe0720fd381f5a9b3c2cbebcd295c728f34 100644 (file)
@@ -10,16 +10,16 @@ package org.opendaylight.yangtools.odlext.parser;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.odlext.model.api.AnyxmlSchemaLocationEffectiveStatement;
 import org.opendaylight.yangtools.odlext.model.api.AnyxmlSchemaLocationStatement;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
 
 /**
  * Source-specific mapping of prefixes to namespaces.
  */
-public interface AnyxmlSchemaLocationNamespace extends IdentifierNamespace<StatementDefinition,
+public interface AnyxmlSchemaLocationNamespace extends ParserNamespace<StatementDefinition,
         Mutable<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement, AnyxmlSchemaLocationEffectiveStatement>> {
     NamespaceBehaviour<StatementDefinition, Mutable<SchemaNodeIdentifier, AnyxmlSchemaLocationStatement,
         AnyxmlSchemaLocationEffectiveStatement>,
index 1d623551e4a8b9ee6230d54640661321d9743134..68f242edd03d2758ccb73b8dbdb7bfe4709f1878 100644 (file)
@@ -11,8 +11,8 @@ import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.Empty;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Namespace for remembering the {@code yang-data} argument's QName. This namespace is necessary because we are forced
@@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
  */
 @Beta
 // FIXME: YANGTOOLS-1196: remove this namespace once we can bind freely
-public interface YangDataArgumentNamespace extends IdentifierNamespace<Empty, QName> {
+public interface YangDataArgumentNamespace extends ParserNamespace<Empty, QName> {
     NamespaceBehaviour<Empty, QName, @NonNull YangDataArgumentNamespace> BEHAVIOUR =
         NamespaceBehaviour.statementLocal(YangDataArgumentNamespace.class);
 
index 9ceacb93227757c40085814d4df57469d060f534..fbe10607f0a04a34d7a2104536b633f53ffab646 100644 (file)
@@ -37,7 +37,6 @@ import org.opendaylight.yangtools.yang.common.Revision;
 import org.opendaylight.yangtools.yang.common.YangVersion;
 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.RevisionSourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode;
@@ -49,6 +48,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.Namesp
 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.NamespaceNotAvailableException;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.SomeModifiersUnresolvedException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport;
@@ -159,7 +159,7 @@ final class BuildGlobalContext extends NamespaceStorageSupport implements Regist
     }
 
     @Override
-    public <K, V, N extends IdentifierNamespace<K, V>> NamespaceBehaviourWithListeners<K, V, N> getNamespaceBehaviour(
+    public <K, V, N extends ParserNamespace<K, V>> NamespaceBehaviourWithListeners<K, V, N> getNamespaceBehaviour(
             final Class<N> type) {
         NamespaceBehaviourWithListeners<?, ?, ?> potential = supportedNamespaces.get(type);
         if (potential == null) {
@@ -182,7 +182,7 @@ final class BuildGlobalContext extends NamespaceStorageSupport implements Regist
     }
 
     @SuppressWarnings({ "unchecked", "rawtypes" })
-    private <K, V, N extends IdentifierNamespace<K, V>> NamespaceBehaviourWithListeners<K, V, N> createNamespaceContext(
+    private <K, V, N extends ParserNamespace<K, V>> NamespaceBehaviourWithListeners<K, V, N> createNamespaceContext(
             final NamespaceBehaviour<K, V, N> potentialRaw) {
         if (potentialRaw instanceof DerivedNamespaceBehaviour) {
             final VirtualNamespaceContext derivedContext = new VirtualNamespaceContext(
index a4e5067c19d0743637589b678ec5cea899f82127..d8e74317d19cd00c14063da386625dfde24761aa 100644 (file)
@@ -23,10 +23,10 @@ import java.util.function.Function;
 import org.eclipse.jdt.annotation.NonNull;
 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.parser.spi.meta.ModelActionBuilder;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceKeyCriterion;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
@@ -119,7 +119,7 @@ final class ModifierImpl implements ModelActionBuilder {
     }
 
     @SuppressWarnings({ "rawtypes", "unchecked" })
-    private <K, C extends Mutable<?, ?, ?>, N extends IdentifierNamespace<K, ? extends StmtContext<?, ?, ?>>>
+    private <K, C extends Mutable<?, ?, ?>, N extends ParserNamespace<K, ? extends StmtContext<?, ?, ?>>>
             AbstractPrerequisite<C> mutatesCtxImpl(final StmtContext<?, ?, ?> context, final Class<N> namespace,
                     final K key, final ModelProcessingPhase phase) {
         checkNotRegistered();
@@ -227,20 +227,20 @@ final class ModifierImpl implements ModelActionBuilder {
 
     @Override
     @Deprecated
-    public <N extends IdentifierNamespace<?, ?>> Prerequisite<Mutable<?, ?, ?>> mutatesNs(
-            final Mutable<?, ?, ?> context, final Class<N> namespace) {
+    public <N extends ParserNamespace<?, ?>> Prerequisite<Mutable<?, ?, ?>> mutatesNs(final Mutable<?, ?, ?> context,
+            final Class<N> namespace) {
         return addMutation(new NamespaceMutation<>(contextImpl(context), namespace));
     }
 
     @Override
-    public <K, E extends EffectiveStatement<?, ?>, N extends IdentifierNamespace<K, ? extends StmtContext<?, ?, ?>>>
+    public <K, E extends EffectiveStatement<?, ?>, N extends ParserNamespace<K, ? extends StmtContext<?, ?, ?>>>
             AbstractPrerequisite<Mutable<?, ?, E>> mutatesEffectiveCtx(final StmtContext<?, ?, ?> context,
                     final Class<N> namespace, final K key) {
         return mutatesCtxImpl(context, namespace, key, EFFECTIVE_MODEL);
     }
 
     @Override
-    public <K, E extends EffectiveStatement<?, ?>, N extends IdentifierNamespace<K, ? extends StmtContext<?, ?, ?>>>
+    public <K, E extends EffectiveStatement<?, ?>, N extends ParserNamespace<K, ? extends StmtContext<?, ?, ?>>>
             AbstractPrerequisite<Mutable<?, ?, E>> mutatesEffectiveCtxPath(final StmtContext<?, ?, ?> context,
                     final Class<N> namespace, final Iterable<K> keys) {
         checkNotRegistered();
@@ -321,7 +321,7 @@ final class ModifierImpl implements ModelActionBuilder {
         }
     }
 
-    private final class NamespaceMutation<N extends IdentifierNamespace<?, ?>>
+    private final class NamespaceMutation<N extends ParserNamespace<?, ?>>
             extends AbstractPrerequisite<Mutable<?, ?, ?>>  {
         NamespaceMutation(final StatementContextBase<?, ?, ?> ctx, final Class<N> namespace) {
             resolvePrereq(ctx);
@@ -385,7 +385,7 @@ final class ModifierImpl implements ModelActionBuilder {
      * give us the first step. When it does, we hook onto the first item to provide us the second step and so on.
      */
     private final class PhaseModificationInNamespacePath<C extends Mutable<?, ?, ?>, K,
-            N extends IdentifierNamespace<K, ? extends StmtContext<?, ?, ?>>> extends AbstractPrerequisite<C>
+            N extends ParserNamespace<K, ? extends StmtContext<?, ?, ?>>> extends AbstractPrerequisite<C>
             implements OnNamespaceItemAdded, ContextMutation {
         private final ModelProcessingPhase modPhase;
         private final Iterable<K> keys;
index 1ac8f661e3fb9eca9213f838022046d9bfd02f28..a268e8ae52c94b6f584fdbb4a524181f8d7e7057 100644 (file)
@@ -15,10 +15,10 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
-abstract class NamespaceBehaviourWithListeners<K, V, N extends IdentifierNamespace<K, V>>
+abstract class NamespaceBehaviourWithListeners<K, V, N extends ParserNamespace<K, V>>
         extends NamespaceBehaviour<K, V, N> {
 
     abstract static class ValueAddedListener<K> {
index e6aef831e19f38f9897d321ca5b88109f3436524..3ab90d5680c3e22bb9c39a014b0d9340e17075f9 100644 (file)
@@ -15,12 +15,12 @@ import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Optional;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
 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.NamespaceKeyCriterion;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceNotAvailableException;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
@@ -50,7 +50,7 @@ abstract class NamespaceStorageSupport implements NamespaceStorageNode {
      */
     public abstract @NonNull Registry getBehaviourRegistry();
 
-    protected void checkLocalNamespaceAllowed(final Class<? extends IdentifierNamespace<?, ?>> type) {
+    protected void checkLocalNamespaceAllowed(final Class<? extends ParserNamespace<?, ?>> type) {
         // NOOP
     }
 
@@ -59,31 +59,31 @@ abstract class NamespaceStorageSupport implements NamespaceStorageNode {
      *
      * @throws SourceException instance of SourceException
      */
-    protected <K, V, N extends IdentifierNamespace<K, V>> void onNamespaceElementAdded(final Class<N> type, final K key,
+    protected <K, V, N extends ParserNamespace<K, V>> void onNamespaceElementAdded(final Class<N> type, final K key,
             final V value) {
         // NOOP
     }
 
-    public final <K, V, N extends IdentifierNamespace<K, V>> Optional<Entry<K, V>> getFromNamespace(
+    public final <K, V, N extends ParserNamespace<K, V>> Optional<Entry<K, V>> getFromNamespace(
             final Class<N> type, final NamespaceKeyCriterion<K> criterion) {
         return getBehaviourRegistry().getNamespaceBehaviour(type).getFrom(this, criterion);
     }
 
-    public final <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getNamespace(final Class<N> type) {
+    public final <K, V, N extends ParserNamespace<K, V>> Map<K, V> getNamespace(final Class<N> type) {
         return getBehaviourRegistry().getNamespaceBehaviour(type).getAllFrom(this);
     }
 
     @SuppressWarnings("unchecked")
-    final <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getLocalNamespace(final Class<N> type) {
+    final <K, V, N extends ParserNamespace<K, V>> Map<K, V> getLocalNamespace(final Class<N> type) {
         return (Map<K, V>) accessNamespaces().get(type);
     }
 
-    final <K, V, T extends K, U extends V, N extends IdentifierNamespace<K, V>> void addToNamespace(
+    final <K, V, T extends K, U extends V, N extends ParserNamespace<K, V>> void addToNamespace(
             final Class<N> type, final T key, final U value) {
         getBehaviourRegistry().getNamespaceBehaviour(type).addTo(this, key, value);
     }
 
-    final <K, V, T extends K, U extends V, N extends IdentifierNamespace<K, V>> void addToNamespace(
+    final <K, V, T extends K, U extends V, N extends ParserNamespace<K, V>> void addToNamespace(
             final Class<N> type, final Map<T, U> map) {
         final NamespaceBehaviour<K, V, N> behavior = getBehaviourRegistry().getNamespaceBehaviour(type);
         for (final Entry<T, U> validationBundle : map.entrySet()) {
@@ -109,20 +109,20 @@ abstract class NamespaceStorageSupport implements NamespaceStorageNode {
 
     @SuppressWarnings("unchecked")
     @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) {
         final Map<K, V> localNamespace = (Map<K, V>) accessNamespaces().get(type);
         return localNamespace == null ? null : localNamespace.get(key);
     }
 
     @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) {
         @SuppressWarnings("unchecked")
         final Map<K, V> localNamespace = (Map<K, V>) accessNamespaces().get(type);
         return localNamespace;
     }
 
     @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) {
         final V ret = ensureLocalNamespace(type).put(key, value);
         onNamespaceElementAdded(type, key, value);
@@ -130,7 +130,7 @@ abstract class NamespaceStorageSupport implements NamespaceStorageNode {
     }
 
     @Override
-    public <K, V, N extends IdentifierNamespace<K, V>> V putToLocalStorageIfAbsent(final Class<N> type, final K key,
+    public <K, V, N extends ParserNamespace<K, V>> V putToLocalStorageIfAbsent(final Class<N> type, final K key,
             final V value) {
         final V ret = ensureLocalNamespace(type).putIfAbsent(key, value);
         if (ret == null) {
@@ -164,7 +164,7 @@ abstract class NamespaceStorageSupport implements NamespaceStorageNode {
         return verifyNotNull(namespaces, "Attempted to access swept namespaces of %s", this);
     }
 
-    private <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> ensureLocalNamespace(final Class<N> type) {
+    private <K, V, N extends ParserNamespace<K, V>> Map<K, V> ensureLocalNamespace(final Class<N> type) {
         @SuppressWarnings("unchecked")
         Map<K, V> ret = (Map<K,V>) accessNamespaces().get(type);
         if (ret == null) {
index 32a7fe387a514e76678d8e7e2ec596ef6296b5a2..d8283e8882d0577ffa201b30a01b29153ddbe439 100644 (file)
@@ -23,7 +23,6 @@ import org.opendaylight.yangtools.yang.common.YangVersion;
 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.api.meta.StatementDefinition;
 import org.opendaylight.yangtools.yang.model.api.stmt.AugmentStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.ConfigEffectiveStatement;
@@ -37,6 +36,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelActionBuilder;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.Registry;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContextUtils;
@@ -279,29 +279,29 @@ abstract class ReactorStmtCtx<A, D extends DeclaredStatement<A>, E extends Effec
     //
 
     @Override
-    public final <K, V, T extends K, N extends IdentifierNamespace<K, V>> V namespaceItem(final Class<@NonNull N> type,
+    public final <K, V, T extends K, N extends ParserNamespace<K, V>> V namespaceItem(final Class<@NonNull N> type,
             final T key) {
         return getBehaviourRegistry().getNamespaceBehaviour(type).getFrom(this, key);
     }
 
     @Override
-    public final <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> namespace(final Class<@NonNull N> type) {
+    public final <K, V, N extends ParserNamespace<K, V>> Map<K, V> namespace(final Class<@NonNull N> type) {
         return getNamespace(type);
     }
 
     @Override
-    public final <K, V, N extends IdentifierNamespace<K, V>>
+    public final <K, V, N extends ParserNamespace<K, V>>
             Map<K, V> localNamespacePortion(final Class<@NonNull N> type) {
         return getLocalNamespace(type);
     }
 
     @Override
-    protected final void checkLocalNamespaceAllowed(final Class<? extends IdentifierNamespace<?, ?>> type) {
+    protected final void checkLocalNamespaceAllowed(final Class<? extends ParserNamespace<?, ?>> type) {
         definition().checkNamespaceAllowed(type);
     }
 
     @Override
-    protected <K, V, N extends IdentifierNamespace<K, V>> void onNamespaceElementAdded(final Class<N> type, final K key,
+    protected <K, V, N extends ParserNamespace<K, V>> void onNamespaceElementAdded(final Class<N> type, final K key,
             final V value) {
         // definition().onNamespaceElementAdded(this, type, key, value);
     }
index 5491d4ae7f20a25cefc1cb35a287d91138bfd05c..c870df6b4e0aab669d1f406397069cc9a2ba86e4 100644 (file)
@@ -16,11 +16,11 @@ import org.opendaylight.yangtools.yang.common.QNameModule;
 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.parser.spi.meta.CopyHistory;
 import org.opendaylight.yangtools.yang.parser.spi.meta.CopyType;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
 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.StatementNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
@@ -131,8 +131,8 @@ final class ReplicaStatementContext<A, D extends DeclaredStatement<A>, E extends
     }
 
     @Override
-    public <K, V, T extends K, U extends V, N extends IdentifierNamespace<K, V>> void addToNs(
-            final Class<@NonNull N> type, final T key, final U value) {
+    public <K, V, T extends K, U extends V, N extends ParserNamespace<K, V>> void addToNs(final Class<@NonNull N> type,
+            final T key, final U value) {
         throw new UnsupportedOperationException();
     }
 
index 63f035db044cc7a207c60814f0eb12b8191c8cd5..2ca6a97aa3b6056d9c9ce041947148ab23d58bfb 100644 (file)
@@ -28,7 +28,6 @@ import org.opendaylight.yangtools.yang.common.YangVersion;
 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;
@@ -38,6 +37,7 @@ 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;
@@ -130,7 +130,7 @@ public final class RootStatementContext<A, D extends DeclaredStatement<A>, E ext
     }
 
     @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()) {
@@ -143,7 +143,7 @@ public final class RootStatementContext<A, D extends DeclaredStatement<A>, E ext
     }
 
     @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<>());
     }
 
@@ -151,7 +151,7 @@ public final class RootStatementContext<A, D extends DeclaredStatement<A>, E ext
      * 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) {
@@ -172,7 +172,7 @@ public final class RootStatementContext<A, D extends DeclaredStatement<A>, E ext
     }
 
     @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<>());
     }
 
@@ -180,7 +180,7 @@ public final class RootStatementContext<A, D extends DeclaredStatement<A>, E ext
      * 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) {
index 0e619a78d935ba9e022a837c2dbeef36ef9bdba5..69d4e374e32dc2a6934f81048fefcbc12fa4ba40 100644 (file)
@@ -11,10 +11,10 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
-final class SimpleNamespaceContext<K, V, N extends IdentifierNamespace<K, V>>
+final class SimpleNamespaceContext<K, V, N extends ParserNamespace<K, V>>
         extends NamespaceBehaviourWithListeners<K, V, N> {
     // FIXME: Change this to Multimap, once issue with modules is resolved.
     private List<KeyedValueAddedListener<K>> listeners;
index 7c733cbad7ce1d8287027e0c4ebd45c94d607ea8..190c1d550169ad4f0880b99f1491808dc8f48e3e 100644 (file)
@@ -28,7 +28,6 @@ import org.opendaylight.yangtools.concepts.Mutable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.YangVersion;
-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.meta.InferenceException;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelActionBuilder;
@@ -36,6 +35,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
 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.StatementDefinitionNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupportBundle;
@@ -199,7 +199,7 @@ final class SourceSpecificContext implements NamespaceStorageNode, NamespaceBeha
     }
 
     @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) {
         // RootStatementContext takes care of IncludedModuleContext and the rest...
         final V ret = getRoot().putToLocalStorage(type, key, value);
@@ -209,7 +209,7 @@ final class SourceSpecificContext implements NamespaceStorageNode, NamespaceBeha
     }
 
     @Override
-    public <K, V, N extends IdentifierNamespace<K, V>> V putToLocalStorageIfAbsent(final Class<N> type, final K key,
+    public <K, V, N extends ParserNamespace<K, V>> V putToLocalStorageIfAbsent(final Class<N> type, final K key,
            final V value) {
         // RootStatementContext takes care of IncludedModuleContext and the rest...
         final V ret = getRoot().putToLocalStorageIfAbsent(type, key, value);
@@ -225,7 +225,7 @@ final class SourceSpecificContext implements NamespaceStorageNode, NamespaceBeha
     }
 
     @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) {
         final V potentialLocal = getRoot().getFromLocalStorage(type, key);
         if (potentialLocal != null) {
             return potentialLocal;
@@ -241,7 +241,7 @@ final class SourceSpecificContext implements NamespaceStorageNode, NamespaceBeha
     }
 
     @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) {
         final Map<K, V> potentialLocal = getRoot().getAllFromLocalStorage(type);
         if (potentialLocal != null) {
             return potentialLocal;
@@ -258,7 +258,7 @@ final class SourceSpecificContext implements NamespaceStorageNode, NamespaceBeha
     }
 
     @Override
-    public <K, V, N extends IdentifierNamespace<K, V>> NamespaceBehaviour<K, V, N> getNamespaceBehaviour(
+    public <K, V, N extends ParserNamespace<K, V>> NamespaceBehaviour<K, V, N> getNamespaceBehaviour(
             final Class<N> type) {
         return globalContext.getNamespaceBehaviour(type);
     }
index 505dbae678b068538733b1ec248d4c609cd8efcd..899345574ab9f99a4d4ccbd137ba599788e9861b 100644 (file)
@@ -34,7 +34,6 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 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.api.meta.StatementDefinition;
 import org.opendaylight.yangtools.yang.parser.spi.meta.CopyHistory;
 import org.opendaylight.yangtools.yang.parser.spi.meta.CopyType;
@@ -44,6 +43,7 @@ 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;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceKeyCriterion;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport.CopyPolicy;
@@ -166,7 +166,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
     }
 
     @Override
-    public final <K, V, T extends K, U extends V, N extends IdentifierNamespace<K, V>> void addToNs(
+    public final <K, V, T extends K, U extends V, N extends ParserNamespace<K, V>> void addToNs(
             final Class<@NonNull N> type, final T key, final U value) {
         addToNamespace(type, key, value);
     }
@@ -457,7 +457,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
         return definition;
     }
 
-    final <K, V, N extends IdentifierNamespace<K, V>> void onNamespaceItemAddedAction(final Class<N> type, final K key,
+    final <K, V, N extends ParserNamespace<K, V>> void onNamespaceItemAddedAction(final Class<N> type, final K key,
             final OnNamespaceItemAdded listener) {
         final Object potential = getFromNamespace(type, key);
         if (potential != null) {
@@ -474,7 +474,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
         });
     }
 
-    final <K, V, N extends IdentifierNamespace<K, V>> void onNamespaceItemAddedAction(final Class<N> type,
+    final <K, V, N extends ParserNamespace<K, V>> void onNamespaceItemAddedAction(final Class<N> type,
             final ModelProcessingPhase phase, final NamespaceKeyCriterion<K> criterion,
             final OnNamespaceItemAdded listener) {
         final Optional<Entry<K, V>> existing = getFromNamespace(type, criterion);
@@ -500,7 +500,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
         });
     }
 
-    final <K, V, N extends IdentifierNamespace<K, V>> void selectMatch(final Class<N> type,
+    final <K, V, N extends ParserNamespace<K, V>> void selectMatch(final Class<N> type,
             final NamespaceKeyCriterion<K> criterion, final OnNamespaceItemAdded listener) {
         final Optional<Entry<K, V>> optMatch = getFromNamespace(type, criterion);
         checkState(optMatch.isPresent(), "Failed to find a match for criterion %s in namespace %s node %s", criterion,
@@ -509,7 +509,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
         listener.namespaceItemAdded(StatementContextBase.this, type, match.getKey(), match.getValue());
     }
 
-    final <K, V, N extends IdentifierNamespace<K, V>> void waitForPhase(final Object value, final Class<N> type,
+    final <K, V, N extends ParserNamespace<K, V>> void waitForPhase(final Object value, final Class<N> type,
             final ModelProcessingPhase phase, final NamespaceKeyCriterion<K> criterion,
             final OnNamespaceItemAdded listener) {
         ((StatementContextBase<?, ? ,?>) value).addPhaseCompletedListener(phase,
@@ -519,7 +519,7 @@ public abstract class StatementContextBase<A, D extends DeclaredStatement<A>, E
             });
     }
 
-    private <K, V, N extends IdentifierNamespace<K, V>> NamespaceBehaviourWithListeners<K, V, N> getBehaviour(
+    private <K, V, N extends ParserNamespace<K, V>> NamespaceBehaviourWithListeners<K, V, N> getBehaviour(
             final Class<N> type) {
         final NamespaceBehaviour<K, V, N> behaviour = getBehaviourRegistry().getNamespaceBehaviour(type);
         checkArgument(behaviour instanceof NamespaceBehaviourWithListeners, "Namespace %s does not support listeners",
index b7df52b3c603f6f7309106795989053005fc65cc..58bee310b2ffe8c6280f220f84b6c2a7794de4d8 100644 (file)
@@ -20,10 +20,10 @@ import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.model.api.meta.ArgumentDefinition;
 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.api.meta.StatementDefinition;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ImplicitParentAwareStatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementFactory;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupport;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
@@ -51,7 +51,7 @@ public class StatementDefinitionContext<A, D extends DeclaredStatement<A>, E ext
         return support.adaptArgumentValue(context, targetModule);
     }
 
-    public void checkNamespaceAllowed(final Class<? extends IdentifierNamespace<?,?>> namespace) {
+    public void checkNamespaceAllowed(final Class<? extends ParserNamespace<?,?>> namespace) {
         // Noop
     }
 
index 2df2fe5d36bd5f40f01c061f5f7a6a59f1ec6a71..f3badc71558c0d0fa394cfc1a9378221c4acc034 100644 (file)
@@ -9,10 +9,10 @@ package org.opendaylight.yangtools.yang.parser.stmt.reactor;
 
 import com.google.common.collect.HashMultimap;
 import com.google.common.collect.Multimap;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.DerivedNamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
-final class VirtualNamespaceContext<K, V, N extends IdentifierNamespace<K, V>, D>
+final class VirtualNamespaceContext<K, V, N extends ParserNamespace<K, V>, D>
         extends NamespaceBehaviourWithListeners<K, V, N> {
 
     private final Multimap<D, KeyedValueAddedListener<K>> listeners = HashMultimap.create();
index 9118076996fb9c7cb7cd26fb73f3685e0962e101..b2a91c0b3d221793acc92fcef3c63e99cb96ba30 100644 (file)
@@ -10,15 +10,15 @@ package org.opendaylight.yangtools.yang.parser.rfc7950.namespace;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Implementation-internal cache for looking up URI to import prefix. URIs are taken in as Strings to save ourselves
  * some quality parsing time.
  */
 @Beta
-public interface ModuleQNameToPrefix extends IdentifierNamespace<QNameModule, String> {
+public interface ModuleQNameToPrefix extends ParserNamespace<QNameModule, String> {
     NamespaceBehaviour<QNameModule, String, @NonNull ModuleQNameToPrefix> BEHAVIOUR =
             NamespaceBehaviour.rootStatementLocal(ModuleQNameToPrefix.class);
 }
index b18997c9bde8571461924df098692d735061086b..dceb43aad521b692d9ae93c0c9e6c100d96e1174 100644 (file)
@@ -12,13 +12,13 @@ import static com.google.common.base.Verify.verify;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.YangNamespaceContext;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext.Mutable;
 
 @Beta
-public interface YangNamespaceContextNamespace extends IdentifierNamespace<StmtContext<?, ?, ?>, YangNamespaceContext> {
+public interface YangNamespaceContextNamespace extends ParserNamespace<StmtContext<?, ?, ?>, YangNamespaceContext> {
     NamespaceBehaviour<StmtContext<?, ?, ?>, YangNamespaceContext, @NonNull YangNamespaceContextNamespace> BEHAVIOUR =
             NamespaceBehaviour.global(YangNamespaceContextNamespace.class);
 
index abe287400e435187d179f22149be0c5bf68b2b97..fa4b706f42714956e668b0c536fa867a06b093d6 100644 (file)
@@ -10,8 +10,8 @@ package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.augment;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
 
 /**
@@ -20,7 +20,7 @@ import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase;
  */
 @Beta
 public interface AugmentImplicitHandlingNamespace
-        extends IdentifierNamespace<Empty, StatementContextBase<?, ?, ?>> {
+        extends ParserNamespace<Empty, StatementContextBase<?, ?, ?>> {
     NamespaceBehaviour<Empty, StatementContextBase<?, ?, ?>, @NonNull AugmentImplicitHandlingNamespace>
         BEHAVIOUR = NamespaceBehaviour.statementLocal(AugmentImplicitHandlingNamespace.class);
 
index 7ac07871f3975e1a2b0ada27d9f01f53cb03a651..ee965ef75d8abdbe3c655696b44de6526a084aa8 100644 (file)
@@ -10,15 +10,15 @@ package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.import_;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.Empty;
-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.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Statement-local namespace carrying the versioning information about how the import was satisfied.
  */
 @Beta
-public interface ImportedVersionNamespace extends IdentifierNamespace<Empty, SourceIdentifier> {
+public interface ImportedVersionNamespace extends ParserNamespace<Empty, SourceIdentifier> {
     NamespaceBehaviour<Empty, SourceIdentifier, @NonNull ImportedVersionNamespace> BEHAVIOUR =
         NamespaceBehaviour.statementLocal(ImportedVersionNamespace.class);
 
index 8baf2cdacfbb8b53ddd6744cb3dcac3079dcf28a..9282f157c8d96c58f71f802e60b23bbf7ff7c3d1 100644 (file)
@@ -9,12 +9,12 @@ package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.list;
 
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
 
 @Beta
-public interface ConfigListWarningNamespace extends IdentifierNamespace<StatementSourceReference, Boolean> {
+public interface ConfigListWarningNamespace extends ParserNamespace<StatementSourceReference, Boolean> {
     NamespaceBehaviour<StatementSourceReference, Boolean, @NonNull ConfigListWarningNamespace> BEHAVIOUR =
             NamespaceBehaviour.global(ConfigListWarningNamespace.class);
 }
index af714f81f9babb595a0d5698bb63b3077c31b24f..f8fee1405d272bd16edb77ec4335c66072f4b273 100644 (file)
@@ -11,14 +11,14 @@ import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.Empty;
 import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Module-local namespace holding the module's QName.
  */
 @Beta
-public interface QNameModuleNamespace extends IdentifierNamespace<Empty, QNameModule> {
+public interface QNameModuleNamespace extends ParserNamespace<Empty, QNameModule> {
     NamespaceBehaviour<Empty, QNameModule, @NonNull QNameModuleNamespace> BEHAVIOUR =
         NamespaceBehaviour.statementLocal(QNameModuleNamespace.class);
 
index 3f1cea44405a967debc3fc0e9276ddd23488aca0..59dbd37fe113c4d89ef8f705000f8895c65235b4 100644 (file)
@@ -10,12 +10,12 @@ package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.type;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 @Beta
-public interface BaseTypeNamespace extends IdentifierNamespace<Empty, StmtContext<?, ?, ?>> {
+public interface BaseTypeNamespace extends ParserNamespace<Empty, StmtContext<?, ?, ?>> {
     NamespaceBehaviour<Empty, StmtContext<?, ?, ?>, @NonNull BaseTypeNamespace> BEHAVIOUR =
         NamespaceBehaviour.statementLocal(BaseTypeNamespace.class);
 }
index 007f9048dd67ca6efa42f7291c6350fc78dc3545..fc4f50fa2faf2785fb7f51150ab2339739f7cb59 100644 (file)
@@ -10,12 +10,12 @@ package org.opendaylight.yangtools.yang.parser.rfc7950.stmt.uses;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 @Beta
-public interface SourceGroupingNamespace extends IdentifierNamespace<Empty, StmtContext<?, ?, ?>> {
+public interface SourceGroupingNamespace extends ParserNamespace<Empty, StmtContext<?, ?, ?>> {
     NamespaceBehaviour<Empty, StmtContext<?, ?, ?>, @NonNull SourceGroupingNamespace> BEHAVIOUR =
         NamespaceBehaviour.statementLocal(SourceGroupingNamespace.class);
 }
index c16a1d5cdf54813a94eedfd5531519008bae3109..50d54c88ca9dd22630b13790dddd707da121b5dd 100644 (file)
@@ -9,13 +9,13 @@ package org.opendaylight.yangtools.yang.thirdparty.plugin;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.Empty;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * ThirdPartyNamespace.
  */
-public interface ThirdPartyNamespace extends IdentifierNamespace<Empty, String> {
+public interface ThirdPartyNamespace extends ParserNamespace<Empty, String> {
     @NonNull NamespaceBehaviour<Empty, String, @NonNull ThirdPartyNamespace> BEHAVIOR =
         NamespaceBehaviour.statementLocal(ThirdPartyNamespace.class);
 
index 4560154e154f9968b176595afa4a3b006e9b8c16..ea4e1308cef3cb1b71be24deb7ebc33a9c8818e0 100644 (file)
@@ -49,12 +49,6 @@ public final class SchemaTreeNamespace<D extends DeclaredStatement<QName>,
         return (SchemaTreeNamespace<D, E>) INSTANCE;
     }
 
-    @Override
-    public StmtContext<?, D, E> get(final QName key) {
-        // FIXME: 7.0.0: this method needs to be well-defined
-        return null;
-    }
-
     /**
      * {@inheritDoc}
      *
index a8919aa153b8dfe31e287a4e859bb887d314a590..b65895154cd4d03802dd33b899a34ad36e5ca5f1 100644 (file)
@@ -11,7 +11,6 @@ import static java.util.Objects.requireNonNull;
 
 import com.google.common.base.MoreObjects.ToStringHelper;
 import java.util.Map;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 
 /**
  * An {@link NamespaceBehaviour} which derives keys from a different namespace.
@@ -22,8 +21,8 @@ import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
  * @param <L> Original key type
  * @param <O> Original namespace type
  */
-public abstract class DerivedNamespaceBehaviour<K, V, L, N extends IdentifierNamespace<K, V>,
-       O extends IdentifierNamespace<L, ?>> extends NamespaceBehaviour<K, V, N> {
+public abstract class DerivedNamespaceBehaviour<K, V, L, N extends ParserNamespace<K, V>,
+       O extends ParserNamespace<L, ?>> extends NamespaceBehaviour<K, V, N> {
 
     private final Class<O> derivedFrom;
 
index d02d4e8c493ba4f080f274cd4c23e7569f06a50a..f62115aafe16415187ae16ef317bb4adc5049e18 100644 (file)
@@ -7,8 +7,6 @@
  */
 package org.opendaylight.yangtools.yang.parser.spi.meta;
 
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
-
 /**
  * Special namespace which allows import of namespaces from other sources.
  *
@@ -22,6 +20,6 @@ import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
  *
  * @param <K> Imported context identifier
  */
-public interface ImportedNamespaceContext<K> extends IdentifierNamespace<K, StmtContext<?, ?, ?>> {
+public interface ImportedNamespaceContext<K> extends ParserNamespace<K, StmtContext<?, ?, ?>> {
 
 }
index a956306ada3dc81c2ded9db2acd872ddde8afe83..93e17b0495faa9cf5fc797aa29c9ba6443966804 100644 (file)
@@ -15,7 +15,6 @@ import java.util.Collection;
 import org.eclipse.jdt.annotation.NonNull;
 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.parser.spi.meta.StmtContext.Mutable;
 
 /**
@@ -188,11 +187,11 @@ public interface ModelActionBuilder {
         return mutatesCtx(context, EFFECTIVE_MODEL);
     }
 
-    <K, E extends EffectiveStatement<?, ?>, N extends IdentifierNamespace<K, ? extends StmtContext<?, ?, ?>>>
+    <K, E extends EffectiveStatement<?, ?>, N extends ParserNamespace<K, ? extends StmtContext<?, ?, ?>>>
         @NonNull Prerequisite<Mutable<?, ?, E>> mutatesEffectiveCtx(StmtContext<?, ?, ?> context, Class<N> namespace,
                 K key);
 
-    default <K, E extends EffectiveStatement<?, ?>, N extends IdentifierNamespace<K, ? extends StmtContext<?, ?, ?>>>
+    default <K, E extends EffectiveStatement<?, ?>, N extends ParserNamespace<K, ? extends StmtContext<?, ?, ?>>>
         @NonNull Prerequisite<Mutable<?, ?, E>> mutatesEffectiveCtxPath(final StmtContext<?, ?, ?> context,
                 final Class<N> namespace, final Iterable<K> keys) {
         throw new UnsupportedOperationException(getClass() + " does not implement mutatesEffectiveCtxPath()");
@@ -262,6 +261,6 @@ public interface ModelActionBuilder {
      * @deprecated Undocumented method. Use at your own risk.
      */
     @Deprecated
-    <N extends IdentifierNamespace<?, ?>> @NonNull Prerequisite<Mutable<?,?,?>> mutatesNs(Mutable<?,?, ?> ctx,
+    <N extends ParserNamespace<?, ?>> @NonNull Prerequisite<Mutable<?,?,?>> mutatesNs(Mutable<?,?, ?> ctx,
             Class<N> namespace);
 }
index cfa2898bb606751d3864e26ba1517d6144b8cca7..8e0dd1ce18e7bafbe8c4b30837a378574b9557f1 100644 (file)
@@ -20,7 +20,6 @@ import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.concepts.AbstractSimpleIdentifiable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeAwareEffectiveStatement;
 import org.opendaylight.yangtools.yang.model.api.stmt.SchemaTreeEffectiveStatement;
 import org.opendaylight.yangtools.yang.parser.spi.SchemaTreeNamespace;
@@ -38,7 +37,7 @@ import org.opendaylight.yangtools.yang.parser.spi.SchemaTreeNamespace;
  * @param <V> Value type
  * @param <N> Namespace Type
  */
-public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K, V>>
+public abstract class NamespaceBehaviour<K, V, N extends ParserNamespace<K, V>>
         extends AbstractSimpleIdentifiable<Class<N>> {
 
     public enum StorageNodeType {
@@ -72,7 +71,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
          * @return Namespace behaviour
          * @throws NamespaceNotAvailableException when the namespace is not available
          */
-        <K, V, N extends IdentifierNamespace<K, V>> NamespaceBehaviour<K, V, N> getNamespaceBehaviour(Class<N> type);
+        <K, V, N extends ParserNamespace<K, V>> NamespaceBehaviour<K, V, N> getNamespaceBehaviour(Class<N> type);
     }
 
     public interface NamespaceStorageNode {
@@ -85,9 +84,9 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
 
         @Nullable NamespaceStorageNode getParentNamespaceStorage();
 
-        <K, V, N extends IdentifierNamespace<K, V>> @Nullable V getFromLocalStorage(Class<N> type, K key);
+        <K, V, N extends ParserNamespace<K, V>> @Nullable V getFromLocalStorage(Class<N> type, K key);
 
-        <K, V, N extends IdentifierNamespace<K, V>> @Nullable Map<K, V> getAllFromLocalStorage(Class<N> type);
+        <K, V, N extends ParserNamespace<K, V>> @Nullable Map<K, V> getAllFromLocalStorage(Class<N> type);
 
         /**
          * Populate specified namespace with a key/value pair, overwriting previous contents. Similar to
@@ -98,7 +97,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
          * @param value Value
          * @return Previously-stored value, or null if the key was not present
          */
-        <K, V, N extends IdentifierNamespace<K, V>> @Nullable V putToLocalStorage(Class<N> type, K key, V value);
+        <K, V, N extends ParserNamespace<K, V>> @Nullable V putToLocalStorage(Class<N> type, K key, V value);
 
         /**
          * Populate specified namespace with a key/value pair unless the key is already associated with a value. Similar
@@ -109,8 +108,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
          * @param value Value
          * @return Preexisting value or null if there was no previous mapping
          */
-        <K, V, N extends IdentifierNamespace<K, V>> @Nullable V putToLocalStorageIfAbsent(Class<N> type, K key,
-                V value);
+        <K, V, N extends ParserNamespace<K, V>> @Nullable V putToLocalStorageIfAbsent(Class<N> type, K key, V value);
     }
 
     /**
@@ -157,7 +155,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
      * @param <N> type parameter
      * @return global namespace behaviour for supplied namespace type.
      */
-    public static <K, V, N extends IdentifierNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> global(
+    public static <K, V, N extends ParserNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> global(
             final Class<N> identifier) {
         return new StorageSpecific<>(identifier, StorageNodeType.GLOBAL);
     }
@@ -173,12 +171,12 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
      * @param <N> type parameter
      * @return source-local namespace behaviour for supplied namespace type.
      */
-    public static <K, V, N extends IdentifierNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> sourceLocal(
+    public static <K, V, N extends ParserNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> sourceLocal(
             final Class<N> identifier) {
         return new StorageSpecific<>(identifier, StorageNodeType.SOURCE_LOCAL_SPECIAL);
     }
 
-    public static <K, V, N extends IdentifierNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> statementLocal(
+    public static <K, V, N extends ParserNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> statementLocal(
            final Class<N> identifier) {
         return new StatementLocal<>(identifier);
     }
@@ -194,7 +192,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
      * @param <N> type parameter
      * @return root-statement-local namespace behaviour for supplied namespace type.
      */
-    public static <K, V, N extends IdentifierNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> rootStatementLocal(
+    public static <K, V, N extends ParserNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> rootStatementLocal(
             final Class<N> identifier) {
         return new StorageSpecific<>(identifier, StorageNodeType.ROOT_STATEMENT_LOCAL);
     }
@@ -210,7 +208,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
      * @param <N> type parameter
      * @return tree-scoped namespace behaviour for supplied namespace type.
      */
-    public static <K, V, N extends IdentifierNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> treeScoped(
+    public static <K, V, N extends ParserNamespace<K, V>> @NonNull NamespaceBehaviour<K, V, N> treeScoped(
             final Class<N> identifier) {
         return new TreeScoped<>(identifier);
     }
@@ -288,7 +286,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
         storage.putToLocalStorage(getIdentifier(), key, value);
     }
 
-    abstract static class AbstractSpecific<K, V, N extends IdentifierNamespace<K, V>>
+    abstract static class AbstractSpecific<K, V, N extends ParserNamespace<K, V>>
             extends NamespaceBehaviour<K, V, N> {
         AbstractSpecific(final Class<N> identifier) {
             super(identifier);
@@ -312,7 +310,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
         abstract NamespaceStorageNode findStorageNode(NamespaceStorageNode storage);
     }
 
-    static final class StatementLocal<K, V, N extends IdentifierNamespace<K, V>> extends AbstractSpecific<K, V, N> {
+    static final class StatementLocal<K, V, N extends ParserNamespace<K, V>> extends AbstractSpecific<K, V, N> {
         StatementLocal(final Class<N> identifier) {
             super(identifier);
         }
@@ -323,7 +321,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
         }
     }
 
-    static final class StorageSpecific<K, V, N extends IdentifierNamespace<K, V>> extends AbstractSpecific<K, V, N> {
+    static final class StorageSpecific<K, V, N extends ParserNamespace<K, V>> extends AbstractSpecific<K, V, N> {
         private final StorageNodeType storageType;
 
         StorageSpecific(final Class<N> identifier, final StorageNodeType type) {
@@ -342,7 +340,7 @@ public abstract class NamespaceBehaviour<K, V, N extends IdentifierNamespace<K,
         }
     }
 
-    static final class TreeScoped<K, V, N extends IdentifierNamespace<K, V>> extends NamespaceBehaviour<K, V, N> {
+    static final class TreeScoped<K, V, N extends ParserNamespace<K, V>> extends NamespaceBehaviour<K, V, N> {
         TreeScoped(final Class<N> identifier) {
             super(identifier);
         }
index 8806c13c7527486dcf1d814f542fa8d7dc6bbad2..95fa54cec56feeb20e68af94bf1659184acde821 100644 (file)
@@ -11,7 +11,6 @@ import com.google.common.annotations.Beta;
 import java.util.Map;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 
 /**
  * Support work with namespace content.
@@ -27,7 +26,7 @@ public interface NamespaceStmtCtx extends CommonStmtCtx {
      * @param nsType namespace type class
      * @return Namespace contents, if available
      */
-    <K, V, N extends IdentifierNamespace<K, V>> @Nullable Map<K, V> namespace(Class<@NonNull N> nsType);
+    <K, V, N extends ParserNamespace<K, V>> @Nullable Map<K, V> namespace(Class<@NonNull N> nsType);
 
     /**
      * Return a value associated with specified key within a namespace.
@@ -41,7 +40,7 @@ public interface NamespaceStmtCtx extends CommonStmtCtx {
      * @return Value, or null if there is no element
      * @throws NamespaceNotAvailableException when the namespace is not available.
      */
-    <K, V, T extends K, N extends IdentifierNamespace<K, V>> @Nullable V namespaceItem(Class<@NonNull N> nsType, T key);
+    <K, V, T extends K, N extends ParserNamespace<K, V>> @Nullable V namespaceItem(Class<@NonNull N> nsType, T key);
 
     /**
      * Return the portion of specified namespace stored in this node. Depending on namespace behaviour this may or may
@@ -57,7 +56,7 @@ public interface NamespaceStmtCtx extends CommonStmtCtx {
      * @param nsType namespace type class
      * @return Namespace portion stored in this node, if available
      */
-    <K, V, N extends IdentifierNamespace<K, V>> @Nullable Map<K, V> localNamespacePortion(Class<@NonNull N> nsType);
+    <K, V, N extends ParserNamespace<K, V>> @Nullable Map<K, V> localNamespacePortion(Class<@NonNull N> nsType);
 
     /**
      * Return the selected namespace.
@@ -69,7 +68,7 @@ public interface NamespaceStmtCtx extends CommonStmtCtx {
      * @return Namespace contents, if available
      */
     // TODO: migrate users away
-    default <K, V, N extends IdentifierNamespace<K, V>> Map<K, V> getAllFromNamespace(final Class<N> nsType) {
+    default <K, V, N extends ParserNamespace<K, V>> Map<K, V> getAllFromNamespace(final Class<N> nsType) {
         return namespace(nsType);
     }
 
@@ -86,7 +85,7 @@ public interface NamespaceStmtCtx extends CommonStmtCtx {
      * @throws NamespaceNotAvailableException when the namespace is not available.
      */
     // TODO: migrate users away
-    default <K, V, T extends K, N extends IdentifierNamespace<K, V>>
+    default <K, V, T extends K, N extends ParserNamespace<K, V>>
             @Nullable V getFromNamespace(final Class<@NonNull N> type, final T key) {
         return namespaceItem(type, key);
     }
diff --git a/yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ParserNamespace.java b/yang/yang-parser-spi/src/main/java/org/opendaylight/yangtools/yang/parser/spi/meta/ParserNamespace.java
new file mode 100644 (file)
index 0000000..7b15a30
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * 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;
+
+/**
+ * {@link ParserNamespace} serves as common superclass for namespaces used during parser operation. Each such namespace,
+ * is a type-captured subclass. This type capture of namespace allows for handy type-safe reading methods such as
+ * {@link NamespaceStmtCtx#getFromNamespace(Class, Object)} and still allows introduction of new namespaces without need
+ * to change APIs.
+ *
+ * @param <K> Identifier type
+ * @param <V> Value type
+ */
+@Beta
+public interface ParserNamespace<K, V> {
+
+}
index 4394b6b4954074c3e8b9bffeab1ffeb99d77793f..d9ca2c879707d2adee72429e87b8cf35e2229225 100644 (file)
@@ -10,13 +10,12 @@ package org.opendaylight.yangtools.yang.parser.spi.meta;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.concepts.SemVer;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 
 /**
  * Namespace class for storing semantic version of yang modules.
  */
 @Beta
-public interface SemanticVersionNamespace extends IdentifierNamespace<StmtContext<?, ?, ?>, SemVer> {
+public interface SemanticVersionNamespace extends ParserNamespace<StmtContext<?, ?, ?>, SemVer> {
     NamespaceBehaviour<StmtContext<?, ?, ?>, SemVer, @NonNull SemanticVersionNamespace> BEHAVIOUR =
             NamespaceBehaviour.global(SemanticVersionNamespace.class);
 
index f851c299a4b38e455410c14a3ccc181a056a8f8c..d19812c3cf208bb61c5461d89cc4d34f1ea74014 100644 (file)
@@ -10,7 +10,6 @@ package org.opendaylight.yangtools.yang.parser.spi.meta;
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
 
 /**
@@ -20,7 +19,7 @@ import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
  * @author Robert Varga
  */
 @Beta
-public interface StatementDefinitionNamespace extends IdentifierNamespace<QName, StatementSupport<?, ?, ?>> {
+public interface StatementDefinitionNamespace extends ParserNamespace<QName, StatementSupport<?, ?, ?>> {
     NamespaceBehaviour<QName, StatementSupport<?, ?, ?>, @NonNull StatementDefinitionNamespace> BEHAVIOUR =
             NamespaceBehaviour.global(StatementDefinitionNamespace.class);
 
index e108098e23d9431e74c131c8fa03fc6bc4f3e54e..04eaa93eb500e0ee84fe20e2d257e2f68bae9bc4 100644 (file)
@@ -9,12 +9,9 @@ package org.opendaylight.yangtools.yang.parser.spi.meta;
 
 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;
 
-public interface StatementNamespace<K, D extends DeclaredStatement<?>, E extends EffectiveStatement<?, D>> extends
-        IdentifierNamespace<K, StmtContext<?, D, E>> {
-    @Override
-    StmtContext<?, D, E> get(K key);
+public interface StatementNamespace<K, D extends DeclaredStatement<?>, E extends EffectiveStatement<?, D>>
+        extends ParserNamespace<K, StmtContext<?, D, E>> {
 
     interface TreeScoped<K, D extends DeclaredStatement<?>, E extends EffectiveStatement<?, D>> extends
             StatementNamespace<K, D, E> {
index 10ead73f2e1e67d7c88db50126e570b85aad74d8..a78dd7279513bc3d3f968404b1da7ac2cd7421ca 100644 (file)
@@ -23,7 +23,6 @@ import java.util.Set;
 import org.opendaylight.yangtools.concepts.Immutable;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.common.YangVersion;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -101,7 +100,7 @@ public final class StatementSupportBundle implements Immutable, NamespaceBehavio
 
     @Override
     @SuppressWarnings("unchecked")
-    public <K, V, N extends IdentifierNamespace<K, V>> NamespaceBehaviour<K, V, N> getNamespaceBehaviour(
+    public <K, V, N extends ParserNamespace<K, V>> NamespaceBehaviour<K, V, N> getNamespaceBehaviour(
             final Class<N> namespace) {
         final NamespaceBehaviour<?, ?, ?> potential = namespaceDefinitions.get(namespace);
         if (potential != null) {
@@ -116,7 +115,7 @@ public final class StatementSupportBundle implements Immutable, NamespaceBehavio
         return null;
     }
 
-    public <K, V, N extends IdentifierNamespace<K, V>> boolean hasNamespaceBehaviour(final Class<N> namespace) {
+    public <K, V, N extends ParserNamespace<K, V>> boolean hasNamespaceBehaviour(final Class<N> namespace) {
         if (namespaceDefinitions.containsKey(namespace)) {
             return true;
         }
@@ -185,7 +184,7 @@ public final class StatementSupportBundle implements Immutable, NamespaceBehavio
             return this;
         }
 
-        public <K, V, N extends IdentifierNamespace<K, V>> Builder addSupport(
+        public <K, V, N extends ParserNamespace<K, V>> Builder addSupport(
                 final NamespaceBehaviour<K, V, N> namespaceSupport) {
             final Class<N> identifier = namespaceSupport.getIdentifier();
             checkState(!namespaces.containsKey(identifier));
index 7fb27c88dd054acc8e1caadca3f08a9dc9ac03ca..d61be1ed02351567562740bb6bfa60210e36a07a 100644 (file)
@@ -22,7 +22,6 @@ import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.common.YangVersion;
 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.api.meta.StatementDefinition;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
@@ -219,7 +218,7 @@ public interface StmtContext<A, D extends DeclaredStatement<A>, E extends Effect
          * @param <U> value type
          * @throws NamespaceNotAvailableException when the namespace is not available.
          */
-        <K, V, T extends K, U extends V, N extends IdentifierNamespace<K, V>> void addToNs(Class<@NonNull N> type,
+        <K, V, T extends K, U extends V, N extends ParserNamespace<K, V>> void addToNs(Class<@NonNull N> type,
                 T key, U value);
 
         @Override
index dc65d03f3281208d4c88913f636e855a958e2285..6b04899f195197a77869df973ce5d598a0e17e70 100644 (file)
@@ -8,13 +8,13 @@
 package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Source-specific mapping of prefixes to namespaces.
  */
-public interface BelongsToPrefixToModuleName extends IdentifierNamespace<String, String> {
+public interface BelongsToPrefixToModuleName extends ParserNamespace<String, String> {
     NamespaceBehaviour<String, String, @NonNull BelongsToPrefixToModuleName> BEHAVIOUR =
             NamespaceBehaviour.sourceLocal(BelongsToPrefixToModuleName.class);
 }
index 3ef1096155e8eeb17b994b35090bc45efefe72a4..5e8d660b67dd5f4bd932fb920238f42fbdeaebbf 100644 (file)
@@ -9,13 +9,13 @@ package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import java.net.URI;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Pre-linkage source-specific mapping of prefixes to module namespaces.
  */
-public interface ImpPrefixToNamespace extends IdentifierNamespace<String, URI> {
+public interface ImpPrefixToNamespace extends ParserNamespace<String, URI> {
     NamespaceBehaviour<String, URI, @NonNull ImpPrefixToNamespace> BEHAVIOUR =
             NamespaceBehaviour.rootStatementLocal(ImpPrefixToNamespace.class);
 }
index f30ab336f30041acbd86115ab71f8adbd6f4d422..9ab50474d3c0191528998c74cbc4cb8ec3bf2322 100644 (file)
@@ -8,14 +8,14 @@
 package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 /**
  * Source-specific mapping of prefix strings to module context.
  */
-public interface ImportPrefixToModuleCtx extends  IdentifierNamespace<String, StmtContext<?, ?, ?>> {
+public interface ImportPrefixToModuleCtx extends ParserNamespace<String, StmtContext<?, ?, ?>> {
     NamespaceBehaviour<String, StmtContext<?, ?, ?>, @NonNull ImportPrefixToModuleCtx> BEHAVIOUR =
             NamespaceBehaviour.rootStatementLocal(ImportPrefixToModuleCtx.class);
 }
index d81894c0c9490dd699ab2cb14428738ca0318ac6..6cf340ff38e85dd0fbc1c32943137bc32b9f8bd7 100644 (file)
@@ -9,16 +9,15 @@ package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import com.google.common.annotations.Beta;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.model.repo.api.SemVerSourceIdentifier;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Source-specific mapping of prefixes to source identifier with specified semantic version.
  */
 @Beta
-public interface ImportPrefixToSemVerSourceIdentifier
-    extends IdentifierNamespace<String, SemVerSourceIdentifier> {
+public interface ImportPrefixToSemVerSourceIdentifier extends ParserNamespace<String, SemVerSourceIdentifier> {
     NamespaceBehaviour<String, SemVerSourceIdentifier, @NonNull ImportPrefixToSemVerSourceIdentifier> BEHAVIOUR =
         NamespaceBehaviour.rootStatementLocal(ImportPrefixToSemVerSourceIdentifier.class);
 
index 2b5f97a0de053fbb4f84eb0d154fe70ffdad173a..772ec6504e04d209312ceaee9712d010e595a813 100644 (file)
@@ -8,14 +8,14 @@
 package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 /**
  * Source-specific mapping of prefixes to namespaces.
  */
-public interface IncludedSubmoduleNameToModuleCtx extends IdentifierNamespace<String, StmtContext<?, ?, ?>> {
+public interface IncludedSubmoduleNameToModuleCtx extends ParserNamespace<String, StmtContext<?, ?, ?>> {
     NamespaceBehaviour<String, StmtContext<?, ?, ?>, @NonNull IncludedSubmoduleNameToModuleCtx> BEHAVIOUR =
             NamespaceBehaviour.sourceLocal(IncludedSubmoduleNameToModuleCtx.class);
 }
index c0d097f3c66773d394d0e2f48db5dcb6e0a7d00d..bf5c4448d2dc3ed79531fa552c951b03ddbd753c 100644 (file)
@@ -9,14 +9,14 @@ package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 /**
  * Global mapping of modules to QNameModules.
  */
-public interface ModuleCtxToModuleQName extends IdentifierNamespace<StmtContext<?,?,?>, QNameModule> {
+public interface ModuleCtxToModuleQName extends ParserNamespace<StmtContext<?,?,?>, QNameModule> {
     NamespaceBehaviour<StmtContext<?, ?, ?>, QNameModule, @NonNull ModuleCtxToModuleQName> BEHAVIOUR =
             NamespaceBehaviour.global(ModuleCtxToModuleQName.class);
 
index 040379841e738a913ae98666b15f771bb043933f..36fa78cfc5606e4df34b548eda824cb91d98f1e9 100644 (file)
@@ -8,15 +8,15 @@
 package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import org.eclipse.jdt.annotation.NonNull;
-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.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
 
 /**
  * Global mapping of modules to source identifier.
  */
-public interface ModuleCtxToSourceIdentifier extends IdentifierNamespace<StmtContext<?, ?, ?>, SourceIdentifier> {
+public interface ModuleCtxToSourceIdentifier extends ParserNamespace<StmtContext<?, ?, ?>, SourceIdentifier> {
     NamespaceBehaviour<StmtContext<?, ?, ?>, SourceIdentifier, @NonNull ModuleCtxToSourceIdentifier> BEHAVIOUR =
             NamespaceBehaviour.global(ModuleCtxToSourceIdentifier.class);
 }
index e1ea85abfed47df8faf864acf5033d664fcb2f1b..5387b34437d54fa39e7dc39785f22a0ab311aa17 100644 (file)
@@ -9,13 +9,13 @@ package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Source-specific mapping of prefixes to namespaces.
  */
-public interface ModuleNameToModuleQName extends IdentifierNamespace<String, QNameModule> {
+public interface ModuleNameToModuleQName extends ParserNamespace<String, QNameModule> {
     NamespaceBehaviour<String, QNameModule, @NonNull ModuleNameToModuleQName> BEHAVIOUR =
             NamespaceBehaviour.sourceLocal(ModuleNameToModuleQName.class);
 }
index 49c0c4fab49067006f8fd220191a2591c6a6ef9b..0b516a5bc44ce4e2ae647a9ce9603732ca30fd4c 100644 (file)
@@ -9,13 +9,13 @@ package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import java.net.URI;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Pre-linkage global mapping of module names to namespaces.
  */
-public interface ModuleNameToNamespace extends IdentifierNamespace<String, URI> {
+public interface ModuleNameToNamespace extends ParserNamespace<String, URI> {
     NamespaceBehaviour<String, URI, @NonNull ModuleNameToNamespace> BEHAVIOUR =
             NamespaceBehaviour.global(ModuleNameToNamespace.class);
 }
index 3bce75f8cde8aa89837b36f7e026bc5e87df9775..bf21e26c2284bc75c7ebc949c808c6aff1da2f5a 100644 (file)
@@ -9,13 +9,13 @@ package org.opendaylight.yangtools.yang.parser.spi.source;
 
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Source-specific mapping of prefixes to namespaces.
  */
-public interface ModuleQNameToModuleName extends IdentifierNamespace<QNameModule, String> {
+public interface ModuleQNameToModuleName extends ParserNamespace<QNameModule, String> {
     NamespaceBehaviour<QNameModule, String, @NonNull ModuleQNameToModuleName> BEHAVIOUR =
             NamespaceBehaviour.global(ModuleQNameToModuleName.class);
 }
index 60e03633964e50876ee96fa66d7f52c6183765a7..0224baab217b23ee0c37bdbd5757e2389deaf44a 100644 (file)
@@ -12,8 +12,8 @@ import com.google.common.annotations.Beta;
 import com.google.common.collect.SetMultimap;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Namespace used for storing information about modules that support deviation resolution.
@@ -21,7 +21,7 @@ import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
  */
 @Beta
 public interface ModulesDeviatedByModules
-        extends IdentifierNamespace<ModulesDeviatedByModules.SupportedModules, SetMultimap<QNameModule, QNameModule>> {
+        extends ParserNamespace<ModulesDeviatedByModules.SupportedModules, SetMultimap<QNameModule, QNameModule>> {
     NamespaceBehaviour<SupportedModules, SetMultimap<QNameModule, QNameModule>, @NonNull ModulesDeviatedByModules>
         BEHAVIOUR = NamespaceBehaviour.global(ModulesDeviatedByModules.class);
 
index 6b2a18760b9b7f87107a7532cf82b6c219f833ae..b425a38230f2e607c268314abdfeaeef137e1273 100644 (file)
@@ -11,36 +11,30 @@ import java.net.URISyntaxException;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.yang.common.QNameModule;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Source-specific mapping of prefixes to namespaces.
  */
-public interface PrefixToModule extends IdentifierNamespace<String, QNameModule> {
+public interface PrefixToModule extends ParserNamespace<String, QNameModule> {
     NamespaceBehaviour<String, QNameModule, @NonNull PrefixToModule> BEHAVIOUR =
             NamespaceBehaviour.global(PrefixToModule.class);
     String DEFAULT_PREFIX = "";
 
     /**
-     * Returns QNameModule (namespace + revision) associated with supplied
-     * prefix.
+     * Returns QNameModule (namespace + revision) associated with supplied prefix.
      *
-     * @param prefix
-     *            Prefix
-     * @return QNameModule associated with supplied prefix, or null if prefix is
-     *         not defined.
+     * @param prefix Prefix
+     * @return QNameModule associated with supplied prefix, or null if prefix is not defined.
      */
-    @Override
     QNameModule get(String prefix);
 
     /**
      * Returns QNameModule (namespace + revision) associated with XML namespace (URI).
      *
-     * @param namespace
-     *            XML Namespace
-     * @return QNameModule associated with supplied namespace, or null if prefix
-     *         is not defined.
+     * @param namespace XML Namespace
+     * @return QNameModule associated with supplied namespace, or null if prefix is not defined.
      * @throws URISyntaxException if the input string is not valid URI
      */
     @Nullable QNameModule getByNamespace(String namespace) throws URISyntaxException;
index 8a38c1c663bc7c62e63d09270da9b714a942e245..43c70813004413dca45005c86dba8f39bd4284ea 100644 (file)
@@ -11,34 +11,30 @@ import java.net.URI;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Map of fully qualified statement name to statement definition.
  */
-public interface QNameToStatementDefinition extends IdentifierNamespace<QName, StatementDefinition> {
+public interface QNameToStatementDefinition extends ParserNamespace<QName, StatementDefinition> {
     NamespaceBehaviour<QName, StatementDefinition, @NonNull QNameToStatementDefinition> BEHAVIOUR =
             NamespaceBehaviour.sourceLocal(QNameToStatementDefinition.class);
 
     /**
      * Returns StatementDefinition with specified QName.
      *
-     * @param identifier
-     *            QName of requested statement
+     * @param identifier QName of requested statement
      * @return StatementDefinition
      */
-    @Override
     StatementDefinition get(QName identifier);
 
     /**
      * Returns StatementDefinition with specified namespace and localName.
      *
-     * @param namespace
-     *            namespace of requested statement
-     * @param localName
-     *            localName of requested statement
+     * @param namespace namespace of requested statement
+     * @param localName localName of requested statement
      * @return StatementDefinition
      */
     @Nullable StatementDefinition getByNamespaceAndLocalName(@NonNull URI namespace, @NonNull String localName);
index 1d937d17dc888a51feb4c22b14ad76dbefa6c29f..afb73c7655914593bfc8b814c7aff79b3914686a 100644 (file)
@@ -5,17 +5,16 @@
  * 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.source;
 
 import java.util.Set;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 public interface SupportedFeaturesNamespace
-        extends IdentifierNamespace<SupportedFeaturesNamespace.SupportedFeatures, Set<QName>> {
+        extends ParserNamespace<SupportedFeaturesNamespace.SupportedFeatures, Set<QName>> {
     NamespaceBehaviour<SupportedFeatures, Set<QName>, @NonNull SupportedFeaturesNamespace> BEHAVIOUR =
             NamespaceBehaviour.global(SupportedFeaturesNamespace.class);
 
index 5681ea50cbfff6102a0aa709f81a260ecfd50a8d..18069b3b1faf1842d878f23284f74aec04771981 100644 (file)
@@ -10,15 +10,15 @@ package org.opendaylight.yangtools.yang.parser.spi.validation;
 
 import java.util.Collection;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour;
+import org.opendaylight.yangtools.yang.parser.spi.meta.ParserNamespace;
 
 /**
  * Namespace used for validating whether a node is of some type, e.g. usable target for some operation or has other
  * significant properties.
  */
-public interface ValidationBundlesNamespace extends
-        IdentifierNamespace<ValidationBundlesNamespace.ValidationBundleType, Collection<?>> {
+public interface ValidationBundlesNamespace
+        extends ParserNamespace<ValidationBundlesNamespace.ValidationBundleType, Collection<?>> {
     NamespaceBehaviour<ValidationBundleType, Collection<?>, @NonNull ValidationBundlesNamespace> BEHAVIOUR =
             NamespaceBehaviour.global(ValidationBundlesNamespace.class);