Split out YangIRSchemaSource
[yangtools.git] / parser / yang-parser-impl / src / main / java / org / opendaylight / yangtools / yang / parser / repo / AssembleSources.java
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) {