* Standard, RFC6020 and RFC7950 compliant mode. Imports are satisfied by exact revision match (if specified),
* or by latest available revision.
*/
- REVISION_EXACT_OR_LATEST,
- /**
- * Semantic version based mode. Imports which specify a semantic version (via the OpenConfig extension) will
- * be satisfied by module which exports the latest compatible revision. Imports which do not specify semantic
- * version will be resolved just as they would be via {@link #REVISION_EXACT_OR_LATEST}.
- */
- @Deprecated(since = "7.0.11", forRemoval = true)
- SEMVER_LATEST,
+ REVISION_EXACT_OR_LATEST;
}
}
* Standard, RFC6020 and RFC7950 compliant mode. Imports are satisfied by exact revision match (if specified),
* or by latest available revision.
*/
- REVISION_EXACT_OR_LATEST(FileGenerator.ImportResolutionMode.REVISION_EXACT_OR_LATEST),
- /**
- * Semantic version based mode. Imports which specify a semantic version (via the OpenConfig extension) will
- * be satisfied by module which exports the latest compatible revision. Imports which do not specify semantic
- * version will be resolved just as they would be via {@link #REVISION_EXACT_OR_LATEST}.
- *
- * @deprecated This mode has no users and is deprecated for removal.
- */
- @Deprecated(forRemoval = true, since = "8.0.4")
- SEMVER_LATEST(FileGenerator.ImportResolutionMode.SEMVER_LATEST);
+ REVISION_EXACT_OR_LATEST(FileGenerator.ImportResolutionMode.REVISION_EXACT_OR_LATEST);
private final FileGenerator.@NonNull ImportResolutionMode fileGeneratorMode;
@NonNullByDefault
abstract class GeneratorTaskFactory extends ParserConfigAware {
- private static final YangParserConfiguration SEMVER_CONFIG = YangParserConfiguration.builder()
- .importResolutionMode(org.opendaylight.yangtools.yang.parser.api.ImportResolutionMode.OPENCONFIG_SEMVER)
- .build();
-
private final YangParserConfiguration parserConfig;
GeneratorTaskFactory(final ImportResolutionMode importMode) {
- switch (importMode) {
- case REVISION_EXACT_OR_LATEST:
- parserConfig = YangParserConfiguration.DEFAULT;
- break;
- case SEMVER_LATEST:
- parserConfig = SEMVER_CONFIG;
- break;
- default:
- throw new LinkageError("Unhandled import mode " + importMode);
- }
+ parserConfig = switch (importMode) {
+ case REVISION_EXACT_OR_LATEST -> YangParserConfiguration.DEFAULT;
+ };
}
@Override