import java.util.Arrays;
import java.util.Collection;
import java.util.List;
-import java.util.function.Predicate;
+import java.util.Set;
import org.opendaylight.yangtools.yang.common.QName;
import org.opendaylight.yangtools.yang.model.api.SchemaContext;
-import org.opendaylight.yangtools.yang.model.repo.api.IfFeaturePredicates;
import org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode;
import org.opendaylight.yangtools.yang.parser.rfc6020.repo.YinStatementStreamSource;
import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
*/
@Deprecated
public static SchemaContext parseYangSources(final YangStatementSourceImpl... sources) throws ReactorException {
- return parseYangSources(IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE, sources);
+ return parseYangSources(StatementParserMode.DEFAULT_MODE, sources);
}
/**
* Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
* default mode.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param sources YANG sources to be parsed
*
* @return effective schema context
* @deprecated Migration method only, do not use.
*/
@Deprecated
- public static SchemaContext parseYangSources(final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYangSources(final Set<QName> supportedFeatures,
final YangStatementSourceImpl... sources) throws ReactorException {
- return parseYangSources(isFeatureSupported, StatementParserMode.DEFAULT_MODE, sources);
+ return parseYangSources(supportedFeatures, StatementParserMode.DEFAULT_MODE, sources);
}
/**
@Deprecated
public static SchemaContext parseYangSources(final StatementParserMode statementParserMode,
final YangStatementSourceImpl... sources) throws ReactorException {
- return parseYangSources(IfFeaturePredicates.ALL_FEATURES, statementParserMode, sources);
+ return parseYangSources(null, statementParserMode, sources);
}
/**
* Creates a new effective schema context containing the specified YANG sources.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param statementParserMode mode of statement parser
* @param sources YANG sources to be parsed
*
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
- public static SchemaContext parseYangSources(final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYangSources(final Set<QName> supportedFeatures,
final StatementParserMode statementParserMode, final YangStatementSourceImpl... sources)
throws ReactorException {
final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
- statementParserMode, isFeatureSupported);
+ statementParserMode, supportedFeatures);
reactor.addSources(sources);
return reactor.buildEffective();
* @throws FileNotFoundException if one of the specified files does not exist
*/
public static SchemaContext parseYangSources(final File... files) throws ReactorException, FileNotFoundException {
- return parseYangSources(IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE, files);
+ return parseYangSources(StatementParserMode.DEFAULT_MODE, files);
}
/**
* Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
* default mode.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param files YANG files to be parsed
*
* @return effective schema context
* @throws ReactorException if there is an error in one of the parsed YANG sources
* @throws FileNotFoundException if one of the specified files does not exist
*/
- public static SchemaContext parseYangSources(final Predicate<QName> isFeatureSupported, final File... files)
+ public static SchemaContext parseYangSources(final Set<QName> supportedFeatures, final File... files)
throws ReactorException, FileNotFoundException {
- return parseYangSources(isFeatureSupported, StatementParserMode.DEFAULT_MODE, files);
+ return parseYangSources(supportedFeatures, StatementParserMode.DEFAULT_MODE, files);
}
/**
*/
public static SchemaContext parseYangSources(final StatementParserMode statementParserMode, final File... files)
throws ReactorException, FileNotFoundException {
- return parseYangSources(IfFeaturePredicates.ALL_FEATURES, statementParserMode, files);
+ return parseYangSources(null, statementParserMode, files);
}
/**
* Creates a new effective schema context containing the specified YANG sources.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param statementParserMode mode of statement parser
* @param files YANG files to be parsed
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
* @throws FileNotFoundException if one of the specified files does not exist
*/
- public static SchemaContext parseYangSources(final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYangSources(final Set<QName> supportedFeatures,
final StatementParserMode statementParserMode, final File... files) throws ReactorException,
FileNotFoundException {
final YangStatementSourceImpl[] sources = new YangStatementSourceImpl[files.length];
sources[i] = new YangStatementSourceImpl(new NamedFileInputStream(files[i], files[i].getPath()));
}
- return parseYangSources(isFeatureSupported, statementParserMode, sources);
+ return parseYangSources(supportedFeatures, statementParserMode, sources);
}
/**
*/
public static SchemaContext parseYangSources(final Collection<File> files) throws ReactorException,
FileNotFoundException {
- return parseYangSources(files, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+ return parseYangSources(files, StatementParserMode.DEFAULT_MODE);
}
/**
* Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
* default mode.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param files collection of YANG files to be parsed
*
* @return effective schema context
* @throws ReactorException if there is an error in one of the parsed YANG sources
* @throws FileNotFoundException if one of the specified files does not exist
*/
- public static SchemaContext parseYangSources(final Collection<File> files, final Predicate<QName> isFeatureSupported)
+ public static SchemaContext parseYangSources(final Collection<File> files, final Set<QName> supportedFeatures)
throws ReactorException, FileNotFoundException {
- return parseYangSources(files, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+ return parseYangSources(files, supportedFeatures, StatementParserMode.DEFAULT_MODE);
}
/**
*/
public static SchemaContext parseYangSources(final Collection<File> files, final StatementParserMode statementParserMode)
throws ReactorException, FileNotFoundException {
- return parseYangSources(files, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+ return parseYangSources(files, null, statementParserMode);
}
/**
* Creates a new effective schema context containing the specified YANG sources.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param statementParserMode mode of statement parser
* @param files collection of YANG files to be parsed
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
* @throws FileNotFoundException if one of the specified files does not exist
*/
- public static SchemaContext parseYangSources(final Collection<File> files, final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYangSources(final Collection<File> files, final Set<QName> supportedFeatures,
final StatementParserMode statementParserMode) throws ReactorException, FileNotFoundException {
- return parseYangSources(isFeatureSupported, statementParserMode, files.toArray(new File[files.size()]));
+ return parseYangSources(supportedFeatures, statementParserMode, files.toArray(new File[files.size()]));
}
/**
*/
public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath) throws ReactorException,
FileNotFoundException, URISyntaxException {
- return parseYangSources(yangSourcesDirectoryPath, IfFeaturePredicates.ALL_FEATURES,
- StatementParserMode.DEFAULT_MODE);
+ return parseYangSources(yangSourcesDirectoryPath, StatementParserMode.DEFAULT_MODE);
}
/**
* default mode.
*
* @param yangSourcesDirectoryPath relative path to the directory with YANG files to be parsed
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
*
* @return effective schema context
*
* @throws URISyntaxException if the specified directory does not exist
*/
public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath,
- final Predicate<QName> isFeatureSupported) throws ReactorException, FileNotFoundException,
+ final Set<QName> supportedFeatures) throws ReactorException, FileNotFoundException,
URISyntaxException {
- return parseYangSources(yangSourcesDirectoryPath, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+ return parseYangSources(yangSourcesDirectoryPath, supportedFeatures, StatementParserMode.DEFAULT_MODE);
}
/**
public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath,
final StatementParserMode statementParserMode) throws ReactorException, FileNotFoundException,
URISyntaxException {
- return parseYangSources(yangSourcesDirectoryPath, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+ return parseYangSources(yangSourcesDirectoryPath, null, statementParserMode);
}
/**
* Creates a new effective schema context containing the specified YANG sources.
*
* @param yangSourcesDirectoryPath relative path to the directory with YANG files to be parsed
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param statementParserMode mode of statement parser
*
* @return effective schema context
* @throws URISyntaxException if the specified directory does not exist
*/
public static SchemaContext parseYangSources(final String yangSourcesDirectoryPath,
- final Predicate<QName> isFeatureSupported, final StatementParserMode statementParserMode)
+ final Set<QName> supportedFeatures, final StatementParserMode statementParserMode)
throws ReactorException, FileNotFoundException, URISyntaxException {
final URI directoryPath = YangParserTestUtils.class.getResource(yangSourcesDirectoryPath).toURI();
final File dir = new File(directoryPath);
- return parseYangSources(isFeatureSupported, statementParserMode, dir.listFiles(YANG_FILE_FILTER));
+ return parseYangSources(supportedFeatures, statementParserMode, dir.listFiles(YANG_FILE_FILTER));
}
/**
*/
public static SchemaContext parseYangSource(final String yangSourcePath) throws ReactorException,
FileNotFoundException, URISyntaxException {
- return parseYangSource(yangSourcePath, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+ return parseYangSource(yangSourcePath, StatementParserMode.DEFAULT_MODE);
}
/**
* default mode.
*
* @param yangSourcePath relative path to the YANG file to be parsed
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG model are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG model are resolved
*
* @return effective schema context
*
* @throws FileNotFoundException if the specified file does not exist
* @throws URISyntaxException if the specified file does not exist
*/
- public static SchemaContext parseYangSource(final String yangSourcePath, final Predicate<QName> isFeatureSupported)
+ public static SchemaContext parseYangSource(final String yangSourcePath, final Set<QName> supportedFeatures)
throws ReactorException, FileNotFoundException, URISyntaxException {
- return parseYangSource(yangSourcePath, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+ return parseYangSource(yangSourcePath, supportedFeatures, StatementParserMode.DEFAULT_MODE);
}
/**
*/
public static SchemaContext parseYangSource(final String yangSourcePath, final StatementParserMode statementParserMode)
throws ReactorException, FileNotFoundException, URISyntaxException {
- return parseYangSource(yangSourcePath, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+ return parseYangSource(yangSourcePath, null, statementParserMode);
}
/**
* Creates a new effective schema context containing the specified YANG source.
*
* @param yangSourcePath relative path to the YANG file to be parsed
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG model are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG model are resolved
* @param statementParserMode mode of statement parser
*
* @return effective schema context
* @throws FileNotFoundException if the specified file does not exist
* @throws URISyntaxException if the specified file does not exist
*/
- public static SchemaContext parseYangSource(final String yangSourcePath, final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYangSource(final String yangSourcePath, final Set<QName> supportedFeatures,
final StatementParserMode statementParserMode) throws ReactorException, FileNotFoundException,
URISyntaxException {
final URI sourcePath = YangParserTestUtils.class.getResource(yangSourcePath).toURI();
final File sourceFile = new File(sourcePath);
- return parseYangSources(isFeatureSupported, statementParserMode, sourceFile);
+ return parseYangSources(supportedFeatures, statementParserMode, sourceFile);
}
/**
*/
public static SchemaContext parseYangSources(final List<String> yangDirs, final List<String> yangFiles)
throws FileNotFoundException, ReactorException, URISyntaxException {
- return parseYangSources(yangDirs, yangFiles, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+ return parseYangSources(yangDirs, yangFiles, StatementParserMode.DEFAULT_MODE);
}
/**
*
* @param yangDirs relative paths to the directories containing YANG files to be parsed
* @param yangFiles relative paths to the YANG files to be parsed
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
*
* @return effective schema context
*
* @throws URISyntaxException if one of the specified directories or files does not exist
*/
public static SchemaContext parseYangSources(final List<String> yangDirs, final List<String> yangFiles,
- final Predicate<QName> isFeatureSupported) throws FileNotFoundException, ReactorException,
+ final Set<QName> supportedFeatures) throws FileNotFoundException, ReactorException,
URISyntaxException {
- return parseYangSources(yangDirs, yangFiles, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+ return parseYangSources(yangDirs, yangFiles, supportedFeatures, StatementParserMode.DEFAULT_MODE);
}
/**
public static SchemaContext parseYangSources(final List<String> yangDirs, final List<String> yangFiles,
final StatementParserMode statementParserMode) throws FileNotFoundException, ReactorException,
URISyntaxException {
- return parseYangSources(yangDirs, yangFiles, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+ return parseYangSources(yangDirs, yangFiles, null, statementParserMode);
}
/**
*
* @param yangDirs relative paths to the directories containing YANG files to be parsed
* @param yangFiles relative paths to the YANG files to be parsed
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param statementParserMode mode of statement parser
*
* @return effective schema context
* @throws URISyntaxException if one of the specified directories or files does not exist
*/
public static SchemaContext parseYangSources(final List<String> yangDirs, final List<String> yangFiles,
- final Predicate<QName> isFeatureSupported, final StatementParserMode statementParserMode)
+ final Set<QName> supportedFeatures, final StatementParserMode statementParserMode)
throws FileNotFoundException, ReactorException, URISyntaxException {
final List<File> allYangFiles = new ArrayList<>();
for (final String yangDir : yangDirs) {
allYangFiles.add(new File(filePath));
}
- return parseYangSources(allYangFiles, isFeatureSupported, statementParserMode);
+ return parseYangSources(allYangFiles, supportedFeatures, statementParserMode);
}
private static Collection<File> getYangFiles(final String yangSourcesDirectoryPath) throws URISyntaxException {
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
public static SchemaContext parseYangSources(final List<String> filePaths) throws ReactorException {
- return parseYangSources(filePaths, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+ return parseYangSources(filePaths, StatementParserMode.DEFAULT_MODE);
}
/**
* Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
* default mode.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param filePaths relative paths to the YANG files to be parsed
*
* @return effective schema context
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
- public static SchemaContext parseYangSources(final List<String> filePaths, final Predicate<QName> isFeatureSupported)
+ public static SchemaContext parseYangSources(final List<String> filePaths, final Set<QName> supportedFeatures)
throws ReactorException {
- return parseYangSources(filePaths, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+ return parseYangSources(filePaths, supportedFeatures, StatementParserMode.DEFAULT_MODE);
}
/**
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
- public static SchemaContext parseYangSources(final List<String> filePaths,final StatementParserMode statementParserMode)
- throws ReactorException {
- return parseYangSources(filePaths, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+ public static SchemaContext parseYangSources(final List<String> filePaths,
+ final StatementParserMode statementParserMode) throws ReactorException {
+ return parseYangSources(filePaths, (Set<QName>) null, statementParserMode);
}
/**
* Creates a new effective schema context containing the specified YANG sources.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param statementParserMode mode of statement parser
* @param filePaths relative paths to the YANG files to be parsed
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
public static SchemaContext parseYangSources(final List<String> filePaths,
- final Predicate<QName> isFeatureSupported, final StatementParserMode statementParserMode)
+ final Set<QName> supportedFeatures, final StatementParserMode statementParserMode)
throws ReactorException {
final YangStatementSourceImpl[] sources = new YangStatementSourceImpl[filePaths.size()];
sources[i] = new YangStatementSourceImpl(YangParserTestUtils.class.getResourceAsStream(filePaths.get(i)));
}
- return parseYangSources(isFeatureSupported, statementParserMode, sources);
+ return parseYangSources(supportedFeatures, statementParserMode, sources);
}
/**
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
public static SchemaContext parseYangStreams(final List<InputStream> streams) throws ReactorException {
- return parseYangStreams(streams, IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE);
+ return parseYangStreams(streams, StatementParserMode.DEFAULT_MODE);
}
/**
* default mode.
*
* @param streams input streams containing YANG sources to be parsed
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
*
* @return effective schema context
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
- public static SchemaContext parseYangStreams(final List<InputStream> streams, final Predicate<QName> isFeatureSupported)
+ public static SchemaContext parseYangStreams(final List<InputStream> streams, final Set<QName> supportedFeatures)
throws ReactorException {
- return parseYangStreams(streams, isFeatureSupported, StatementParserMode.DEFAULT_MODE);
+ return parseYangStreams(streams, supportedFeatures, StatementParserMode.DEFAULT_MODE);
}
/**
*/
public static SchemaContext parseYangStreams(final List<InputStream> streams, final StatementParserMode statementParserMode)
throws ReactorException {
- return parseYangStreams(streams, IfFeaturePredicates.ALL_FEATURES, statementParserMode);
+ return parseYangStreams(streams, null, statementParserMode);
}
/**
* Creates a new effective schema context containing the specified YANG sources.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param statementParserMode mode of statement parser
* @param streams input streams containing YANG sources to be parsed
*
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
- public static SchemaContext parseYangStreams(final List<InputStream> streams, final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYangStreams(final List<InputStream> streams, final Set<QName> supportedFeatures,
final StatementParserMode statementParserMode) throws ReactorException {
final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
- statementParserMode, isFeatureSupported);
+ statementParserMode, supportedFeatures);
return reactor.buildEffective(streams);
}
public static SchemaContext parseYangResources(final Class<?> clazz, final String... resources)
throws ReactorException {
final List<InputStream> streams = new ArrayList<>(resources.length);
- for (String r : resources) {
+ for (final String r : resources) {
final InputStream is = clazz.getResourceAsStream(r);
Preconditions.checkArgument(is != null, "Resource %s not found", r);
streams.add(is);
* Creates a new effective schema context containing the specified YANG sources. Statement parser mode is set to
* default mode.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param streams input streams containing YANG sources to be parsed
*
* @return effective schema context
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
- public static SchemaContext parseYangStreams(final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYangStreams(final Set<QName> supportedFeatures,
final InputStream... streams) throws ReactorException {
- return parseYangStreams(Arrays.asList(streams), isFeatureSupported);
+ return parseYangStreams(Arrays.asList(streams), supportedFeatures);
}
/**
/**
* Creates a new effective schema context containing the specified YANG sources.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YANG models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YANG models are resolved
* @param statementParserMode mode of statement parser
* @param streams input streams containing YANG sources to be parsed
*
*
* @throws ReactorException if there is an error in one of the parsed YANG sources
*/
- public static SchemaContext parseYangStreams(final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYangStreams(final Set<QName> supportedFeatures,
final StatementParserMode statementParserMode, final InputStream... streams) throws ReactorException {
- return parseYangStreams(Arrays.asList(streams), isFeatureSupported, statementParserMode);
+ return parseYangStreams(Arrays.asList(streams), supportedFeatures, statementParserMode);
}
/**
* @throws ReactorException if there is an error in one of the parsed YIN sources
*/
public static SchemaContext parseYinSources(final YinStatementStreamSource... sources) throws ReactorException {
- return parseYinSources(IfFeaturePredicates.ALL_FEATURES, StatementParserMode.DEFAULT_MODE, sources);
+ return parseYinSources(StatementParserMode.DEFAULT_MODE, sources);
}
/**
* Creates a new effective schema context containing the specified YIN sources. Statement parser mode is set to
* default mode.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YIN models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YIN models are resolved
* @param sources YIN sources to be parsed
*
* @return effective schema context
* @throws ReactorException if there is an error in one of the parsed YIN sources
*/
- public static SchemaContext parseYinSources(final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYinSources(final Set<QName> supportedFeatures,
final YinStatementStreamSource... sources) throws ReactorException {
- return parseYinSources(isFeatureSupported, StatementParserMode.DEFAULT_MODE, sources);
+ return parseYinSources(supportedFeatures, StatementParserMode.DEFAULT_MODE, sources);
}
/**
*/
public static SchemaContext parseYinSources(final StatementParserMode statementParserMode,
final YinStatementStreamSource... sources) throws ReactorException {
- return parseYinSources(IfFeaturePredicates.ALL_FEATURES, statementParserMode, sources);
+ return parseYinSources(null, statementParserMode, sources);
}
/**
* Creates a new effective schema context containing the specified YIN sources.
*
- * @param isFeatureSupported predicate based on which all if-feature statements in the parsed YIN models are resolved
+ * @param supportedFeatures set of supported features based on which all if-feature statements in the parsed YIN models are resolved
* @param statementParserMode mode of statement parser
* @param sources YIN sources to be parsed
*
*
* @throws ReactorException if there is an error in one of the parsed YIN sources
*/
- public static SchemaContext parseYinSources(final Predicate<QName> isFeatureSupported,
+ public static SchemaContext parseYinSources(final Set<QName> supportedFeatures,
final StatementParserMode statementParserMode, final YinStatementStreamSource... sources)
throws ReactorException {
final CrossSourceStatementReactor.BuildAction reactor = YangInferencePipeline.RFC6020_REACTOR.newBuild(
- statementParserMode, isFeatureSupported);
+ statementParserMode, supportedFeatures);
reactor.addSources(sources);
return reactor.buildEffective();