Split out YangIRSchemaSource 09/102709/5
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 17 Oct 2022 08:47:37 +0000 (10:47 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 1 Nov 2022 16:16:47 +0000 (17:16 +0100)
This is a counterpart to YangTextSchemaSource, publish it to
yang-repo-api. This allows is to be consumed without a direct dependency
on YANG parser.

JIRA: YANGTOOLS-1460
Change-Id: Ia7a9d938b8ed94f9b46cd5a22cb86472160dfd98
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
18 files changed:
parser/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/impl/DefaultYangParser.java
parser/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/AssembleSources.java
parser/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/SharedEffectiveModelContextFactory.java
parser/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/SourceIdMismatchDetector.java
parser/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/repo/YangTextSchemaContextResolver.java
parser/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/AbstractSchemaRepositoryTest.java
parser/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/MultipleRevImportBug6875Test.java
parser/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/OpenconfigVerSharedSchemaRepositoryTest.java
parser/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedEffectiveModelContextFactoryTest.java
parser/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaRepositoryTest.java
parser/yang-parser-impl/src/test/java/org/opendaylight/yangtools/yang/parser/repo/SharedSchemaRepositoryWithFeaturesTest.java
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/TextToIRTransformer.java
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/YangModelDependencyInfo.java
parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/YangStatementStreamSource.java
plugin/yang-maven-plugin/src/main/java/org/opendaylight/yangtools/yang2sources/plugin/YangToSourcesProcessor.java
yang/yang-repo-api/pom.xml
yang/yang-repo-api/src/main/java/module-info.java
yang/yang-repo-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YangIRSchemaSource.java [moved from parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/IRSchemaSource.java with 80% similarity]

index aaa87548a34aa4d9370c908a4b8ef27dafb5db35..b1cf78db9e1045800744f76136889b986be07b7e 100644 (file)
@@ -22,6 +22,7 @@ import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YinDomSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YinTextSchemaSource;
@@ -29,7 +30,6 @@ import org.opendaylight.yangtools.yang.model.repo.api.YinXmlSchemaSource;
 import org.opendaylight.yangtools.yang.parser.api.YangParser;
 import org.opendaylight.yangtools.yang.parser.api.YangParserException;
 import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YinStatementStreamSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YinTextToDomTransformer;
@@ -40,7 +40,7 @@ import org.xml.sax.SAXException;
 
 final class DefaultYangParser implements YangParser {
     static final @NonNull Collection<Class<? extends SchemaSourceRepresentation>> REPRESENTATIONS =
-            ImmutableList.of(IRSchemaSource.class, YangTextSchemaSource.class, YinDomSchemaSource.class,
+            ImmutableList.of(YangIRSchemaSource.class, YangTextSchemaSource.class, YinDomSchemaSource.class,
                 YinXmlSchemaSource.class, YinTextSchemaSource.class);
 
     private final BuildAction buildAction;
@@ -107,8 +107,8 @@ final class DefaultYangParser implements YangParser {
     static StatementStreamSource sourceToStatementStream(final SchemaSourceRepresentation source)
             throws IOException, YangSyntaxErrorException {
         requireNonNull(source);
-        if (source instanceof IRSchemaSource) {
-            return YangStatementStreamSource.create((IRSchemaSource) source);
+        if (source instanceof YangIRSchemaSource) {
+            return YangStatementStreamSource.create((YangIRSchemaSource) source);
         } else if (source instanceof YangTextSchemaSource) {
             return YangStatementStreamSource.create((YangTextSchemaSource) source);
         } else if (source instanceof YinDomSchemaSource) {
index 116a9b5c027a0b7b432aab4433564f2f10cacfc3..2a9dcf219e738f2e5b9803f56e9a32afffd69f85 100644 (file)
@@ -22,20 +22,20 @@ import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactoryConfiguration;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.api.YangParser;
 import org.opendaylight.yangtools.yang.parser.api.YangParserException;
 import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
 import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangModelDependencyInfo;
 import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-final class AssembleSources implements AsyncFunction<List<IRSchemaSource>, EffectiveModelContext> {
+final class AssembleSources implements AsyncFunction<List<YangIRSchemaSource>, EffectiveModelContext> {
     private static final Logger LOG = LoggerFactory.getLogger(AssembleSources.class);
 
-    private final @NonNull Function<IRSchemaSource, SourceIdentifier> getIdentifier;
+    private final @NonNull Function<YangIRSchemaSource, SourceIdentifier> getIdentifier;
     private final @NonNull SchemaContextFactoryConfiguration config;
     private final @NonNull YangParserFactory parserFactory;
 
@@ -44,14 +44,14 @@ final class AssembleSources implements AsyncFunction<List<IRSchemaSource>, Effec
         this.parserFactory = parserFactory;
         this.config = config;
         getIdentifier = switch (config.getStatementParserMode()) {
-            case DEFAULT_MODE -> IRSchemaSource::getIdentifier;
+            case DEFAULT_MODE -> YangIRSchemaSource::getIdentifier;
         };
     }
 
     @Override
-    public FluentFuture<EffectiveModelContext> apply(final List<IRSchemaSource> sources)
+    public FluentFuture<EffectiveModelContext> apply(final List<YangIRSchemaSource> sources)
             throws SchemaResolutionException, ReactorException {
-        final Map<SourceIdentifier, IRSchemaSource> srcs = Maps.uniqueIndex(sources, getIdentifier);
+        final Map<SourceIdentifier, YangIRSchemaSource> srcs = Maps.uniqueIndex(sources, getIdentifier);
         final Map<SourceIdentifier, YangModelDependencyInfo> deps =
                 Maps.transformValues(srcs, YangModelDependencyInfo::forIR);
 
@@ -72,7 +72,7 @@ final class AssembleSources implements AsyncFunction<List<IRSchemaSource>, Effec
         config.getSupportedFeatures().ifPresent(parser::setSupportedFeatures);
         config.getModulesDeviatedByModules().ifPresent(parser::setModulesWithSupportedDeviations);
 
-        for (final Entry<SourceIdentifier, IRSchemaSource> entry : srcs.entrySet()) {
+        for (final Entry<SourceIdentifier, YangIRSchemaSource> entry : srcs.entrySet()) {
             try {
                 parser.addSource(entry.getValue());
             } catch (YangSyntaxErrorException | IOException e) {
index e1b213df3bdfe28a5a004cc385e49338b834a069..63d4fe9f47ca434b3478da51a18b77671eff0e85 100644 (file)
@@ -39,7 +39,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFacto
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactoryConfiguration;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -179,8 +179,8 @@ final class SharedEffectiveModelContextFactory implements EffectiveModelContextF
         final Stopwatch sw = Stopwatch.createStarted();
 
         // Request all sources be loaded
-        ListenableFuture<List<IRSchemaSource>> sf = Futures.allAsList(Collections2.transform(sources,
-            identifier -> repository.getSchemaSource(identifier, IRSchemaSource.class)));
+        ListenableFuture<List<YangIRSchemaSource>> sf = Futures.allAsList(Collections2.transform(sources,
+            identifier -> repository.getSchemaSource(identifier, YangIRSchemaSource.class)));
 
         // Detect mismatch between requested Source IDs and IDs that are extracted from parsed source
         // Also remove duplicates if present
index 625aba14a76c67d9208e72d95b59b59f575e254c..16a2c2d324dcdbace8c47386cb5aa82fc291b374 100644 (file)
@@ -18,12 +18,12 @@ import java.util.Map;
 import java.util.Set;
 import org.gaul.modernizer_maven_annotations.SuppressModernizer;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 @SuppressModernizer
-final class SourceIdMismatchDetector implements Function<List<IRSchemaSource>, List<IRSchemaSource>> {
+final class SourceIdMismatchDetector implements Function<List<YangIRSchemaSource>, List<YangIRSchemaSource>> {
     private static final Logger LOG = LoggerFactory.getLogger(SourceIdMismatchDetector.class);
 
     private final Set<SourceIdentifier> sourceIdentifiers;
@@ -33,13 +33,10 @@ final class SourceIdMismatchDetector implements Function<List<IRSchemaSource>, L
     }
 
     @Override
-    public List<IRSchemaSource> apply(final List<IRSchemaSource> input) {
+    public List<YangIRSchemaSource> apply(final List<YangIRSchemaSource> input) {
         final Iterator<SourceIdentifier> srcIt = sourceIdentifiers.iterator();
-        final Iterator<IRSchemaSource> it = input.iterator();
-
-        final Map<SourceIdentifier, IRSchemaSource> filtered = new LinkedHashMap<>();
-        while (it.hasNext()) {
-            final IRSchemaSource irSchemaSource = it.next();
+        final Map<SourceIdentifier, YangIRSchemaSource> filtered = new LinkedHashMap<>();
+        for (YangIRSchemaSource irSchemaSource : input) {
             final SourceIdentifier realSId = irSchemaSource.getIdentifier();
             if (srcIt.hasNext()) {
                 final SourceIdentifier expectedSId = srcIt.next();
@@ -49,7 +46,7 @@ final class SourceIdMismatchDetector implements Function<List<IRSchemaSource>, L
                 }
             }
 
-            final IRSchemaSource prev = filtered.put(realSId, irSchemaSource);
+            final YangIRSchemaSource prev = filtered.put(realSId, irSchemaSource);
             if (prev != null) {
                 LOG.warn("Duplicate source for module {} detected in reactor", realSId);
             }
index a34493f9a93144d2e8ab373320a9bfba2f293f1e..3ec6803d9d577d265152578127385d20cdaafc99 100644 (file)
@@ -39,6 +39,7 @@ import org.opendaylight.yangtools.yang.model.repo.api.SchemaResolutionException;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceException;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
 import org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.spi.GuavaSchemaSourceCache;
 import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource;
@@ -49,7 +50,6 @@ import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistration;
 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistry;
 import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
 import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -62,7 +62,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
     private final Multimap<SourceIdentifier, YangTextSchemaSource> texts = ArrayListMultimap.create();
     private final AtomicReference<Optional<EffectiveModelContext>> currentSchemaContext =
             new AtomicReference<>(Optional.empty());
-    private final GuavaSchemaSourceCache<IRSchemaSource> cache;
+    private final GuavaSchemaSourceCache<YangIRSchemaSource> cache;
     private final SchemaListenerRegistration transReg;
     private final SchemaSourceRegistry registry;
     private final SchemaRepository repository;
@@ -76,7 +76,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
         final TextToIRTransformer t = TextToIRTransformer.create(repository, registry);
         transReg = registry.registerSchemaSourceListener(t);
 
-        cache = GuavaSchemaSourceCache.createSoftCache(registry, IRSchemaSource.class, SOURCE_LIFETIME);
+        cache = GuavaSchemaSourceCache.createSoftCache(registry, YangIRSchemaSource.class, SOURCE_LIFETIME);
     }
 
     public static @NonNull YangTextSchemaContextResolver create(final String name) {
@@ -102,7 +102,7 @@ public final class YangTextSchemaContextResolver implements AutoCloseable, Schem
             throws SchemaSourceException, IOException, YangSyntaxErrorException {
         checkArgument(source != null);
 
-        final IRSchemaSource ast = TextToIRTransformer.transformText(source);
+        final YangIRSchemaSource ast = TextToIRTransformer.transformText(source);
         LOG.trace("Resolved source {} to source {}", source, ast);
 
         // AST carries an accurate identifier, check if it matches the one supplied by the source. If it
index bf6497a3672cbd6a74dbd9915174940fd88dff74..2e3cf45ef575df57356b9662c9f8f63f560441f8 100644 (file)
@@ -20,9 +20,9 @@ import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.common.QNameModule;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactoryConfiguration;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
 
 public abstract class AbstractSchemaRepositoryTest {
@@ -61,13 +61,13 @@ public abstract class AbstractSchemaRepositoryTest {
             .createEffectiveModelContext(requiredSources);
     }
 
-    private static SettableSchemaProvider<IRSchemaSource> assertYangTextResource(final String resourceName) {
-        final IRSchemaSource yangSource;
+    private static SettableSchemaProvider<YangIRSchemaSource> assertYangTextResource(final String resourceName) {
+        final YangIRSchemaSource yangSource;
         try {
             yangSource = TextToIRTransformer.transformText(YangTextSchemaSource.forResource(resourceName));
         } catch (YangSyntaxErrorException | IOException e) {
             throw new AssertionError("Failed to parse " + resourceName, e);
         }
-        return SettableSchemaProvider.createImmediate(yangSource, IRSchemaSource.class);
+        return SettableSchemaProvider.createImmediate(yangSource, YangIRSchemaSource.class);
     }
 }
index d1956cdeeaa5ba49f479209d6d7dd90bd7837cd1..1d57b89b09915bea935a3c4c84227004a8098c45 100644 (file)
@@ -22,8 +22,8 @@ import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
 
 public class MultipleRevImportBug6875Test {
@@ -38,13 +38,13 @@ public class MultipleRevImportBug6875Test {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
                 "shared-schema-repo-multiple-rev-import-test");
 
-        final SettableSchemaProvider<IRSchemaSource> foo = getSourceProvider(
+        final SettableSchemaProvider<YangIRSchemaSource> foo = getSourceProvider(
             "/rfc7950/bug6875/yang1-1/foo.yang");
-        final SettableSchemaProvider<IRSchemaSource> bar1 = getSourceProvider(
+        final SettableSchemaProvider<YangIRSchemaSource> bar1 = getSourceProvider(
             "/rfc7950/bug6875/yang1-1/bar@1999-01-01.yang");
-        final SettableSchemaProvider<IRSchemaSource> bar2 = getSourceProvider(
+        final SettableSchemaProvider<YangIRSchemaSource> bar2 = getSourceProvider(
             "/rfc7950/bug6875/yang1-1/bar@2017-02-06.yang");
-        final SettableSchemaProvider<IRSchemaSource> bar3 = getSourceProvider(
+        final SettableSchemaProvider<YangIRSchemaSource> bar3 = getSourceProvider(
             "/rfc7950/bug6875/yang1-1/bar@1970-01-01.yang");
 
         setAndRegister(sharedSchemaRepository, foo);
@@ -82,11 +82,11 @@ public class MultipleRevImportBug6875Test {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
                 "shared-schema-repo-multiple-rev-import-test");
 
-        final SettableSchemaProvider<IRSchemaSource> foo = getSourceProvider(
+        final SettableSchemaProvider<YangIRSchemaSource> foo = getSourceProvider(
             "/rfc7950/bug6875/yang1-0/foo.yang");
-        final SettableSchemaProvider<IRSchemaSource> bar1 = getSourceProvider(
+        final SettableSchemaProvider<YangIRSchemaSource> bar1 = getSourceProvider(
             "/rfc7950/bug6875/yang1-0/bar@1999-01-01.yang");
-        final SettableSchemaProvider<IRSchemaSource> bar2 = getSourceProvider(
+        final SettableSchemaProvider<YangIRSchemaSource> bar2 = getSourceProvider(
             "/rfc7950/bug6875/yang1-0/bar@2017-02-06.yang");
 
         setAndRegister(sharedSchemaRepository, foo);
@@ -105,16 +105,16 @@ public class MultipleRevImportBug6875Test {
     }
 
     private static void setAndRegister(final SharedSchemaRepository sharedSchemaRepository,
-            final SettableSchemaProvider<IRSchemaSource> source) {
+            final SettableSchemaProvider<YangIRSchemaSource> source) {
         source.register(sharedSchemaRepository);
         source.setResult();
     }
 
-    private static SettableSchemaProvider<IRSchemaSource> getSourceProvider(final String resourceName)
+    private static SettableSchemaProvider<YangIRSchemaSource> getSourceProvider(final String resourceName)
             throws Exception {
         final YangTextSchemaSource yangSource = YangTextSchemaSource.forResource(resourceName);
         return SettableSchemaProvider.createImmediate(TextToIRTransformer.transformText(yangSource),
-            IRSchemaSource.class);
+            YangIRSchemaSource.class);
     }
 
     private static QName foo(final String localName) {
index b497ebd8df43366643dfdee408a641197ad96392..ba48207abf480db6405152d3e5ee2d43b338c5fd 100644 (file)
@@ -16,8 +16,8 @@ import org.junit.Test;
 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
 
 public class OpenconfigVerSharedSchemaRepositoryTest {
@@ -25,15 +25,15 @@ public class OpenconfigVerSharedSchemaRepositoryTest {
     public void testSharedSchemaRepository() throws Exception {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository("shared-schema-repo-test");
 
-        final SettableSchemaProvider<IRSchemaSource> bar = getImmediateYangSourceProviderFromResource(
+        final SettableSchemaProvider<YangIRSchemaSource> bar = getImmediateYangSourceProviderFromResource(
                 "/openconfig-version/shared-schema-repository/bar@2016-01-01.yang");
         bar.register(sharedSchemaRepository);
         bar.setResult();
-        final SettableSchemaProvider<IRSchemaSource> foo = getImmediateYangSourceProviderFromResource(
+        final SettableSchemaProvider<YangIRSchemaSource> foo = getImmediateYangSourceProviderFromResource(
                 "/openconfig-version/shared-schema-repository/foo.yang");
         foo.register(sharedSchemaRepository);
         foo.setResult();
-        final SettableSchemaProvider<IRSchemaSource> semVer = getImmediateYangSourceProviderFromResource(
+        final SettableSchemaProvider<YangIRSchemaSource> semVer = getImmediateYangSourceProviderFromResource(
                 "/openconfig-version/shared-schema-repository/openconfig-extensions.yang");
         semVer.register(sharedSchemaRepository);
         semVer.setResult();
@@ -55,10 +55,10 @@ public class OpenconfigVerSharedSchemaRepositoryTest {
         assertEquals(moduleSize, schemaContext.getModules().size());
     }
 
-    static SettableSchemaProvider<IRSchemaSource> getImmediateYangSourceProviderFromResource(final String resourceName)
-            throws Exception {
+    static SettableSchemaProvider<YangIRSchemaSource> getImmediateYangSourceProviderFromResource(
+            final String resourceName) throws Exception {
         final YangTextSchemaSource yangSource = YangTextSchemaSource.forResource(resourceName);
         return SettableSchemaProvider.createImmediate(TextToIRTransformer.transformText(yangSource),
-            IRSchemaSource.class);
+            YangIRSchemaSource.class);
     }
 }
index 67d61f827aab7e8cdae31116388890d1dda2f03e..3e1fd08ee25497b178733a04f4576dbee2f17d67 100644 (file)
@@ -25,10 +25,10 @@ import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactoryConfiguration;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.spi.PotentialSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceProvider;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
 
 @RunWith(MockitoJUnitRunner.StrictStubs.class)
@@ -73,7 +73,7 @@ public class SharedEffectiveModelContextFactoryTest {
         s1 = source1.getIdentifier();
         s2 = source2.getIdentifier();
 
-        final SettableSchemaProvider<IRSchemaSource> provider =
+        final SettableSchemaProvider<YangIRSchemaSource> provider =
                 SharedSchemaRepositoryTest.getImmediateYangSourceProviderFromResource(
                     "/no-revision/imported@2012-12-12.yang");
         provider.setResult();
@@ -82,7 +82,7 @@ public class SharedEffectiveModelContextFactoryTest {
         // Register the same provider under source id without revision
         final SourceIdentifier sIdWithoutRevision = new SourceIdentifier(provider.getId().name());
         repository.registerSchemaSource(provider, PotentialSchemaSource.create(
-                sIdWithoutRevision, IRSchemaSource.class, PotentialSchemaSource.Costs.IMMEDIATE.getValue()));
+                sIdWithoutRevision, YangIRSchemaSource.class, PotentialSchemaSource.Costs.IMMEDIATE.getValue()));
 
         final SharedEffectiveModelContextFactory sharedSchemaContextFactory =
             new SharedEffectiveModelContextFactory(repository, config);
index 789007fc27114d6c5bab1e019d22894a089676b0..c5dedea7fd75e242c89a057fd4b4ad9d1315936b 100644 (file)
@@ -24,12 +24,11 @@ import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
 
 public class SharedSchemaRepositoryTest {
-
     @Test
     public void testSourceWithAndWithoutRevision() throws Exception {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository("netconf-mounts");
@@ -39,16 +38,16 @@ public class SharedSchemaRepositoryTest {
         final SourceIdentifier id2 = loadAndRegisterSource(sharedSchemaRepository,
             "/no-revision/imported@2012-12-12.yang");
 
-        ListenableFuture<IRSchemaSource> source = sharedSchemaRepository.getSchemaSource(idNoRevision,
-            IRSchemaSource.class);
+        ListenableFuture<YangIRSchemaSource> source = sharedSchemaRepository.getSchemaSource(idNoRevision,
+            YangIRSchemaSource.class);
         assertEquals(idNoRevision, source.get().getIdentifier());
-        source = sharedSchemaRepository.getSchemaSource(id2, IRSchemaSource.class);
+        source = sharedSchemaRepository.getSchemaSource(id2, YangIRSchemaSource.class);
         assertEquals(id2, source.get().getIdentifier());
     }
 
     private static SourceIdentifier loadAndRegisterSource(final SharedSchemaRepository sharedSchemaRepository,
             final String resourceName) throws Exception {
-        final SettableSchemaProvider<IRSchemaSource> sourceProvider = getImmediateYangSourceProviderFromResource(
+        final SettableSchemaProvider<YangIRSchemaSource> sourceProvider = getImmediateYangSourceProviderFromResource(
             resourceName);
         sourceProvider.setResult();
         final SourceIdentifier idNoRevision = sourceProvider.getId();
@@ -60,11 +59,11 @@ public class SharedSchemaRepositoryTest {
     public void testSimpleSchemaContext() throws Exception {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository("netconf-mounts");
 
-        final SettableSchemaProvider<IRSchemaSource> remoteInetTypesYang = getImmediateYangSourceProviderFromResource(
-            "/ietf/ietf-inet-types@2010-09-24.yang");
+        final SettableSchemaProvider<YangIRSchemaSource> remoteInetTypesYang =
+            getImmediateYangSourceProviderFromResource("/ietf/ietf-inet-types@2010-09-24.yang");
         remoteInetTypesYang.register(sharedSchemaRepository);
-        final ListenableFuture<IRSchemaSource> registeredSourceFuture = sharedSchemaRepository.getSchemaSource(
-            remoteInetTypesYang.getId(), IRSchemaSource.class);
+        final ListenableFuture<YangIRSchemaSource> registeredSourceFuture = sharedSchemaRepository.getSchemaSource(
+            remoteInetTypesYang.getId(), YangIRSchemaSource.class);
         assertFalse(registeredSourceFuture.isDone());
 
         final EffectiveModelContextFactory fact = sharedSchemaRepository.createEffectiveModelContextFactory();
@@ -97,15 +96,15 @@ public class SharedSchemaRepositoryTest {
     public void testTwoSchemaContextsSharingSource() throws Exception {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository("netconf-mounts");
 
-        final SettableSchemaProvider<IRSchemaSource> remoteInetTypesYang = getImmediateYangSourceProviderFromResource(
-            "/ietf/ietf-inet-types@2010-09-24.yang");
+        final SettableSchemaProvider<YangIRSchemaSource> remoteInetTypesYang =
+            getImmediateYangSourceProviderFromResource("/ietf/ietf-inet-types@2010-09-24.yang");
         remoteInetTypesYang.register(sharedSchemaRepository);
         remoteInetTypesYang.setResult();
-        final SettableSchemaProvider<IRSchemaSource> remoteTopologyYang = getImmediateYangSourceProviderFromResource(
-            "/ietf/network-topology@2013-10-21.yang");
+        final SettableSchemaProvider<YangIRSchemaSource> remoteTopologyYang =
+            getImmediateYangSourceProviderFromResource("/ietf/network-topology@2013-10-21.yang");
         remoteTopologyYang.register(sharedSchemaRepository);
         remoteTopologyYang.setResult();
-        final SettableSchemaProvider<IRSchemaSource> remoteModuleNoRevYang =
+        final SettableSchemaProvider<YangIRSchemaSource> remoteModuleNoRevYang =
                 getImmediateYangSourceProviderFromResource("/no-revision/module-without-revision.yang");
         remoteModuleNoRevYang.register(sharedSchemaRepository);
 
@@ -128,8 +127,8 @@ public class SharedSchemaRepositoryTest {
     public void testFailedSchemaContext() throws Exception {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository("netconf-mounts");
 
-        final SettableSchemaProvider<IRSchemaSource> remoteInetTypesYang = getImmediateYangSourceProviderFromResource(
-            "/ietf/ietf-inet-types@2010-09-24.yang");
+        final SettableSchemaProvider<YangIRSchemaSource> remoteInetTypesYang =
+            getImmediateYangSourceProviderFromResource("/ietf/ietf-inet-types@2010-09-24.yang");
         remoteInetTypesYang.register(sharedSchemaRepository);
 
         final EffectiveModelContextFactory fact = sharedSchemaRepository.createEffectiveModelContextFactory();
@@ -157,12 +156,12 @@ public class SharedSchemaRepositoryTest {
     public void testDifferentCosts() throws Exception {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository("netconf-mounts");
 
-        final SettableSchemaProvider<IRSchemaSource> immediateInetTypesYang = spy(
+        final SettableSchemaProvider<YangIRSchemaSource> immediateInetTypesYang = spy(
             getImmediateYangSourceProviderFromResource("/ietf/ietf-inet-types@2010-09-24.yang"));
         immediateInetTypesYang.register(sharedSchemaRepository);
         immediateInetTypesYang.setResult();
 
-        final SettableSchemaProvider<IRSchemaSource> remoteInetTypesYang = spy(
+        final SettableSchemaProvider<YangIRSchemaSource> remoteInetTypesYang = spy(
             getRemoteYangSourceProviderFromResource("/ietf/ietf-inet-types@2010-09-24.yang"));
         remoteInetTypesYang.register(sharedSchemaRepository);
         remoteInetTypesYang.setResult();
@@ -183,17 +182,17 @@ public class SharedSchemaRepositoryTest {
         assertEquals(moduleSize, schemaContext.getModules().size());
     }
 
-    static SettableSchemaProvider<IRSchemaSource> getRemoteYangSourceProviderFromResource(final String resourceName)
+    static SettableSchemaProvider<YangIRSchemaSource> getRemoteYangSourceProviderFromResource(final String resourceName)
             throws Exception {
         final YangTextSchemaSource yangSource = YangTextSchemaSource.forResource(resourceName);
         return SettableSchemaProvider.createRemote(TextToIRTransformer.transformText(yangSource),
-            IRSchemaSource.class);
+            YangIRSchemaSource.class);
     }
 
-    static SettableSchemaProvider<IRSchemaSource> getImmediateYangSourceProviderFromResource(final String resourceName)
-            throws Exception {
+    static SettableSchemaProvider<YangIRSchemaSource> getImmediateYangSourceProviderFromResource(
+            final String resourceName) throws Exception {
         final YangTextSchemaSource yangSource = YangTextSchemaSource.forResource(resourceName);
         return SettableSchemaProvider.createImmediate(TextToIRTransformer.transformText(yangSource),
-            IRSchemaSource.class);
+            YangIRSchemaSource.class);
     }
 }
index 688ec8effe763db44c7947f04e3bbfe746313958..325bf7a9b92c8d581b708bb04401aa91d67cc54e 100644 (file)
@@ -24,8 +24,8 @@ import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.repo.api.EffectiveModelContextFactory;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaContextFactoryConfiguration;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
 
 public class SharedSchemaRepositoryWithFeaturesTest {
@@ -37,7 +37,7 @@ public class SharedSchemaRepositoryWithFeaturesTest {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
                 "shared-schema-repo-with-features-test");
 
-        final SettableSchemaProvider<IRSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+        final SettableSchemaProvider<YangIRSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
             "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
         foobar.register(sharedSchemaRepository);
         foobar.setResult();
@@ -73,7 +73,7 @@ public class SharedSchemaRepositoryWithFeaturesTest {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
                 "shared-schema-repo-with-features-test");
 
-        final SettableSchemaProvider<IRSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+        final SettableSchemaProvider<YangIRSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
             "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
         foobar.register(sharedSchemaRepository);
         foobar.setResult();
@@ -109,7 +109,7 @@ public class SharedSchemaRepositoryWithFeaturesTest {
         final SharedSchemaRepository sharedSchemaRepository = new SharedSchemaRepository(
                 "shared-schema-repo-with-features-test");
 
-        final SettableSchemaProvider<IRSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
+        final SettableSchemaProvider<YangIRSchemaSource> foobar = getImmediateYangSourceProviderFromResource(
             "/if-feature-resolution-test/shared-schema-repository/foobar.yang");
         foobar.register(sharedSchemaRepository);
         foobar.setResult();
@@ -131,11 +131,11 @@ public class SharedSchemaRepositoryWithFeaturesTest {
                 QName.create(module.getQNameModule(), "test-leaf-c"));
     }
 
-    private static SettableSchemaProvider<IRSchemaSource> getImmediateYangSourceProviderFromResource(
+    private static SettableSchemaProvider<YangIRSchemaSource> getImmediateYangSourceProviderFromResource(
             final String resourceName) throws Exception {
         final YangTextSchemaSource yangSource = YangTextSchemaSource.forResource(resourceName);
         return SettableSchemaProvider.createImmediate(TextToIRTransformer.transformText(yangSource),
-            IRSchemaSource.class);
+            YangIRSchemaSource.class);
     }
 
     private static void assertSchemaContext(final SchemaContext schemaContext, final int moduleSize) {
index 7c30b80dc042796e4945a12e0ffc950284de5016..4e1fd353e7cc977532ce2f0e9aa3e46b62811bd4 100644 (file)
@@ -14,6 +14,7 @@ import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.yangtools.yang.ir.IRStatement;
 import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistry;
 import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceTransformer;
@@ -21,9 +22,9 @@ import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.parser.rfc7950.antlr.IRSupport;
 
 @Beta
-public final class TextToIRTransformer extends SchemaSourceTransformer<YangTextSchemaSource, IRSchemaSource> {
+public final class TextToIRTransformer extends SchemaSourceTransformer<YangTextSchemaSource, YangIRSchemaSource> {
     private TextToIRTransformer(final SchemaRepository provider, final SchemaSourceRegistry consumer) {
-        super(provider, YangTextSchemaSource.class, consumer, IRSchemaSource.class,
+        super(provider, YangTextSchemaSource.class, consumer, YangIRSchemaSource.class,
             input -> Futures.immediateFuture(transformText(input)));
     }
 
@@ -32,13 +33,13 @@ public final class TextToIRTransformer extends SchemaSourceTransformer<YangTextS
         return new TextToIRTransformer(provider, consumer);
     }
 
-    public static @NonNull IRSchemaSource transformText(final YangTextSchemaSource text)
+    public static @NonNull YangIRSchemaSource transformText(final YangTextSchemaSource text)
             throws YangSyntaxErrorException, IOException {
         final IRStatement rootStatement = IRSupport.createStatement(YangStatementStreamSource.parseYangSource(text));
         final String name = YangModelDependencyInfo.safeStringArgument(text.getIdentifier(), rootStatement, "name");
         final String latestRevision = YangModelDependencyInfo.getLatestRevision(rootStatement, text.getIdentifier());
         final SourceIdentifier sourceId = new SourceIdentifier(name, latestRevision);
 
-        return new IRSchemaSource(sourceId, rootStatement, text.getSymbolicName().orElse(null));
+        return new YangIRSchemaSource(sourceId, rootStatement, text.getSymbolicName().orElse(null));
     }
 }
index cbfabbe9b221f31af0feaf1ab739f8a2fd8a53ed..ac06338777bb3dd142e2d19f1b81ce4b4cfb9fd8 100644 (file)
@@ -28,6 +28,7 @@ import org.opendaylight.yangtools.yang.model.api.ModuleImport;
 import org.opendaylight.yangtools.yang.model.api.YangStmtMapping;
 import org.opendaylight.yangtools.yang.model.api.stmt.ImportEffectiveStatement;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
 import org.opendaylight.yangtools.yang.parser.spi.source.ExplicitStatement;
@@ -131,7 +132,7 @@ public abstract class YangModelDependencyInfo {
      * @return {@link YangModelDependencyInfo}
      * @throws IllegalArgumentException If the root statement is not a valid YANG module/submodule
      */
-    public static @NonNull YangModelDependencyInfo forIR(final IRSchemaSource source) {
+    public static @NonNull YangModelDependencyInfo forIR(final YangIRSchemaSource source) {
         return forIR(source.getRootStatement(), source.getIdentifier());
     }
 
index 0f6a57c26a9fc31e60e4ade2f9e1618be142fc26..3b74853103c9576e273a6011ebbf8869b2fd25ca 100644 (file)
@@ -23,6 +23,7 @@ import org.opendaylight.yangtools.yang.ir.IRKeyword;
 import org.opendaylight.yangtools.yang.ir.IRStatement;
 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
 import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.parser.antlr.YangStatementLexer;
 import org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser;
@@ -72,13 +73,13 @@ public final class YangStatementStreamSource extends AbstractSimpleIdentifiable<
     }
 
     /**
-     * Create a {@link YangStatementStreamSource} for a {@link IRSchemaSource}.
+     * Create a {@link YangStatementStreamSource} for a {@link YangIRSchemaSource}.
      *
      * @param source YangTextSchemaSource, must not be null
      * @return A new {@link YangStatementStreamSource}
      * @throws NullPointerException if {@code source} is null
      */
-    public static YangStatementStreamSource create(final IRSchemaSource source) {
+    public static YangStatementStreamSource create(final YangIRSchemaSource source) {
         return create(source.getIdentifier(), source.getRootStatement(), source.getSymbolicName().orElse(null));
     }
 
index 3659d81700d8bfa5c670c027be5616b8d2c54c94..628a4ad120e1139fe1ab5e6f7e4cc7fe742960bf 100644 (file)
@@ -37,13 +37,13 @@ import org.apache.maven.project.MavenProject;
 import org.opendaylight.yangtools.plugin.generator.api.FileGeneratorException;
 import org.opendaylight.yangtools.plugin.generator.api.FileGeneratorFactory;
 import org.opendaylight.yangtools.yang.common.YangConstants;
+import org.opendaylight.yangtools.yang.model.repo.api.YangIRSchemaSource;
 import org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource;
 import org.opendaylight.yangtools.yang.parser.api.YangParser;
 import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
 import org.opendaylight.yangtools.yang.parser.api.YangParserException;
 import org.opendaylight.yangtools.yang.parser.api.YangParserFactory;
 import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.IRSchemaSource;
 import org.opendaylight.yangtools.yang.parser.rfc7950.repo.TextToIRTransformer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -172,7 +172,7 @@ class YangToSourcesProcessor {
         }
 
         final Stopwatch watch = Stopwatch.createStarted();
-        final List<Entry<YangTextSchemaSource, IRSchemaSource>> parsed = yangFilesInProject.parallelStream()
+        final List<Entry<YangTextSchemaSource, YangIRSchemaSource>> parsed = yangFilesInProject.parallelStream()
             .map(file -> {
                 final YangTextSchemaSource textSource = YangTextSchemaSource.forPath(file.toPath());
                 try {
@@ -269,14 +269,14 @@ class YangToSourcesProcessor {
     @SuppressWarnings("checkstyle:illegalCatch")
     private Optional<ProcessorModuleReactor> createReactor(final List<File> yangFilesInProject,
             final YangParserConfiguration parserConfig, final Collection<ScannedDependency> dependencies,
-            final List<Entry<YangTextSchemaSource, IRSchemaSource>> parsed) throws MojoExecutionException {
+            final List<Entry<YangTextSchemaSource, YangIRSchemaSource>> parsed) throws MojoExecutionException {
 
         try {
             final List<YangTextSchemaSource> sourcesInProject = new ArrayList<>(yangFilesInProject.size());
             final YangParser parser = parserFactory.createParser(parserConfig);
-            for (final Entry<YangTextSchemaSource, IRSchemaSource> entry : parsed) {
+            for (final Entry<YangTextSchemaSource, YangIRSchemaSource> entry : parsed) {
                 final YangTextSchemaSource textSource = entry.getKey();
-                final IRSchemaSource astSource = entry.getValue();
+                final YangIRSchemaSource astSource = entry.getValue();
                 parser.addSource(astSource);
 
                 if (!astSource.getIdentifier().equals(textSource.getIdentifier())) {
index 05b3f5255376219168de318f10d67a09a8925aa0..3b34a2efda516bf205f2866e2dd119d02701833b 100644 (file)
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-common</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-ir</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.yangtools</groupId>
             <artifactId>yang-model-api</artifactId>
index 8617de349c61cf742fe616f5f4fbd3173bc27f0a..ce8de51621721684788a73db3c8f78715fb3acbe 100644 (file)
@@ -12,6 +12,7 @@ module org.opendaylight.yangtools.yang.repo.api {
     requires transitive com.google.common;
     requires transitive org.opendaylight.yangtools.concepts;
     requires transitive org.opendaylight.yangtools.yang.common;
+    requires transitive org.opendaylight.yangtools.yang.ir;
     requires transitive org.opendaylight.yangtools.yang.model.api;
 
     requires org.opendaylight.yangtools.util;
similarity index 80%
rename from parser/yang-parser-rfc7950/src/main/java/org/opendaylight/yangtools/yang/parser/rfc7950/repo/IRSchemaSource.java
rename to yang/yang-repo-api/src/main/java/org/opendaylight/yangtools/yang/model/repo/api/YangIRSchemaSource.java
index fab8c60bb277219f9eb265c81f043ae43fb44fbf..690ff2de0058b9eb288e148a8ce439de473b007a 100644 (file)
@@ -5,7 +5,7 @@
  * 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.rfc7950.repo;
+package org.opendaylight.yangtools.yang.model.repo.api;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
@@ -18,16 +18,14 @@ import org.opendaylight.yangtools.concepts.AbstractSimpleIdentifiable;
 import org.opendaylight.yangtools.yang.ir.IRKeyword;
 import org.opendaylight.yangtools.yang.ir.IRKeyword.Unqualified;
 import org.opendaylight.yangtools.yang.ir.IRStatement;
-import org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier;
-import org.opendaylight.yangtools.yang.model.repo.api.YangSchemaSourceRepresentation;
 
 @Beta
-public final class IRSchemaSource extends AbstractSimpleIdentifiable<SourceIdentifier>
+public final class YangIRSchemaSource extends AbstractSimpleIdentifiable<SourceIdentifier>
         implements YangSchemaSourceRepresentation {
     private final @NonNull IRStatement rootStatement;
     private final @Nullable String symbolicName;
 
-    public IRSchemaSource(final @NonNull SourceIdentifier identifier, final @NonNull IRStatement rootStatement,
+    public YangIRSchemaSource(final @NonNull SourceIdentifier identifier, final @NonNull IRStatement rootStatement,
             final @Nullable String symbolicName) {
         super(identifier);
         this.rootStatement = requireNonNull(rootStatement);
@@ -53,8 +51,8 @@ public final class IRSchemaSource extends AbstractSimpleIdentifiable<SourceIdent
     }
 
     @Override
-    public Class<IRSchemaSource> getType() {
-        return IRSchemaSource.class;
+    public Class<YangIRSchemaSource> getType() {
+        return YangIRSchemaSource.class;
     }
 
     /**