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;
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);
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) {