import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.List;
import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.common.YangConstants;
}
}
- public static List<Module> findModules(final Collection<? extends Module> modules, final String moduleName) {
- final List<Module> result = new ArrayList<>();
- for (final Module module : modules) {
- if (module.getName().equals(moduleName)) {
- result.add(module);
- }
- }
- return result;
- }
-
public static YangStatementStreamSource sourceForResource(final String resourceName) {
try {
return YangStatementStreamSource.create(YangTextSchemaSource.forPath(Path.of(
}
}
- @Deprecated(forRemoval = true)
- // TestUtils.parseYangSource() instead, but callers need also further cleanup
- public static EffectiveModelContext parseYangSource(final String yangSourcePath) throws ReactorException,
- URISyntaxException, IOException, YangSyntaxErrorException {
- return parseYangSource(yangSourcePath, YangParserConfiguration.DEFAULT, null);
- }
-
public static EffectiveModelContext parseYangSource(final String yangSourcePath, final Set<QName> supportedFeatures)
throws ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
return parseYangSource(yangSourcePath, YangParserConfiguration.DEFAULT, supportedFeatures);
return parseYangSources(config, supportedFeatures, sources);
}
- public static EffectiveModelContext parseYangSources(final Collection<File> files) throws ReactorException,
- IOException, YangSyntaxErrorException {
- return parseYangSources(files, YangParserConfiguration.DEFAULT);
- }
-
- public static EffectiveModelContext parseYangSources(final Collection<File> files,
- final YangParserConfiguration config) throws ReactorException, IOException, YangSyntaxErrorException {
- return parseYangSources(config, null, files.toArray(new File[0]));
- }
-
public static EffectiveModelContext parseYangSources(final String yangSourcesDirectoryPath)
throws ReactorException, URISyntaxException, IOException, YangSyntaxErrorException {
return parseYangSources(yangSourcesDirectoryPath, YangParserConfiguration.DEFAULT);