import org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository;
import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceRegistry;
import org.opendaylight.yangtools.yang.model.repo.spi.SchemaSourceTransformer;
-import org.opendaylight.yangtools.yang.model.spi.source.YangIRSchemaSource;
+import org.opendaylight.yangtools.yang.model.spi.source.YangIRSource;
import org.opendaylight.yangtools.yang.parser.api.YangSyntaxErrorException;
import org.opendaylight.yangtools.yang.parser.rfc7950.antlr.IRSupport;
@Beta
-public final class TextToIRTransformer extends SchemaSourceTransformer<YangTextSource, YangIRSchemaSource> {
+public final class TextToIRTransformer extends SchemaSourceTransformer<YangTextSource, YangIRSource> {
private TextToIRTransformer(final SchemaRepository provider, final SchemaSourceRegistry consumer) {
- super(provider, YangTextSource.class, consumer, YangIRSchemaSource.class,
+ super(provider, YangTextSource.class, consumer, YangIRSource.class,
input -> Futures.immediateFuture(transformText(input)));
}
return new TextToIRTransformer(provider, consumer);
}
- public static @NonNull YangIRSchemaSource transformText(final YangTextSource text)
+ public static @NonNull YangIRSource transformText(final YangTextSource text)
throws YangSyntaxErrorException, IOException {
final var rootStatement = IRSupport.createStatement(YangStatementStreamSource.parseYangSource(text));
final var info = YangIRSourceInfoExtractor.forIR(rootStatement, text.sourceId());
- return new YangIRSchemaSource(info.sourceId(), rootStatement, text.symbolicName());
+ return new YangIRSource(info.sourceId(), rootStatement, text.symbolicName());
}
}