import org.eclipse.jdt.annotation.NonNull;
import org.opendaylight.yangtools.yang.common.YangVersion;
import org.opendaylight.yangtools.yang.parser.api.YangParserConfiguration;
-import org.opendaylight.yangtools.yang.parser.openconfig.stmt.OpenConfigVersionSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.namespace.ModuleQNameToPrefix;
import org.opendaylight.yangtools.yang.parser.rfc7950.namespace.YangNamespaceContextNamespace;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.augment.AugmentImplicitHandlingNamespace;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.if_feature.IfFeatureStatementRFC7950Support;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.import_.ImportStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.import_.ImportedVersionNamespace;
-import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.leaf_list.LeafListStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.list.ConfigListWarningNamespace;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.list.ListStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.ActionStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.IncludeStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.InputStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.KeyStatementSupport;
+import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.LeafListStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.LeafStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.LengthStatementSupport;
import org.opendaylight.yangtools.yang.parser.rfc7950.stmt.meta.MandatoryStatementSupport;
import org.opendaylight.yangtools.yang.parser.spi.SubmoduleNamespace;
import org.opendaylight.yangtools.yang.parser.spi.TypeNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
-import org.opendaylight.yangtools.yang.parser.spi.meta.SemanticVersionModuleNamespace;
-import org.opendaylight.yangtools.yang.parser.spi.meta.SemanticVersionNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.StatementDefinitionNamespace;
import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupportBundle;
import org.opendaylight.yangtools.yang.parser.spi.source.BelongsToModuleContext;
import org.opendaylight.yangtools.yang.parser.spi.source.BelongsToPrefixToModuleName;
import org.opendaylight.yangtools.yang.parser.spi.source.ImpPrefixToNamespace;
import org.opendaylight.yangtools.yang.parser.spi.source.ImportPrefixToModuleCtx;
-import org.opendaylight.yangtools.yang.parser.spi.source.ImportPrefixToSemVerSourceIdentifier;
import org.opendaylight.yangtools.yang.parser.spi.source.ImportedModuleContext;
import org.opendaylight.yangtools.yang.parser.spi.source.IncludedModuleContext;
import org.opendaylight.yangtools.yang.parser.spi.source.IncludedSubmoduleNameToModuleCtx;
private static StatementSupportBundle stmtDefBundle(final StatementSupportBundle linkageBundle,
final YangParserConfiguration config) {
- final InputStatementSupport rfc6020input = InputStatementSupport.rfc6020Instance(config);
- final InputStatementSupport rfc7950input = InputStatementSupport.rfc7950Instance(config);
- final OutputStatementSupport rfc6020output = OutputStatementSupport.rfc6020Instance(config);
- final OutputStatementSupport rfc7950output = OutputStatementSupport.rfc7950Instance(config);
-
return StatementSupportBundle.derivedFrom(linkageBundle)
.addSupport(new YinElementStatementSupport(config))
.addSupport(new ArgumentStatementSupport(config))
.addVersionSpecificSupport(VERSION_1_1, ListStatementSupport.rfc7950Instance(config))
.addSupport(ConfigListWarningNamespace.BEHAVIOUR)
.addSupport(new UniqueStatementSupport(config))
- .addVersionSpecificSupport(VERSION_1_1, new ActionStatementSupport(config, rfc7950input, rfc7950output))
- .addVersionSpecificSupport(VERSION_1, new RpcStatementSupport(config, rfc6020input, rfc6020output))
- .addVersionSpecificSupport(VERSION_1_1, new RpcStatementSupport(config, rfc7950input, rfc7950output))
- .addVersionSpecificSupport(VERSION_1, rfc6020input)
- .addVersionSpecificSupport(VERSION_1_1, rfc7950input)
- .addVersionSpecificSupport(VERSION_1, rfc6020output)
- .addVersionSpecificSupport(VERSION_1_1, rfc7950output)
+ .addVersionSpecificSupport(VERSION_1_1, new ActionStatementSupport(config))
+ .addVersionSpecificSupport(VERSION_1, new RpcStatementSupport(config))
+ .addVersionSpecificSupport(VERSION_1_1, new RpcStatementSupport(config))
+ .addVersionSpecificSupport(VERSION_1, InputStatementSupport.rfc6020Instance(config))
+ .addVersionSpecificSupport(VERSION_1_1, InputStatementSupport.rfc7950Instance(config))
+ .addVersionSpecificSupport(VERSION_1, OutputStatementSupport.rfc6020Instance(config))
+ .addVersionSpecificSupport(VERSION_1_1, OutputStatementSupport.rfc7950Instance(config))
.addVersionSpecificSupport(VERSION_1, new NotificationStatementRFC6020Support(config))
.addVersionSpecificSupport(VERSION_1_1, new NotificationStatementRFC7950Support(config))
.addSupport(new FractionDigitsStatementSupport(config))
public static @NonNull CustomCrossSourceStatementReactorBuilder defaultReactorBuilder(
final YangParserConfiguration config) {
- return addExtensions(vanillaReactorBuilder(config), config);
+ return vanillaReactorBuilder(config);
}
public static @NonNull CustomCrossSourceStatementReactorBuilder defaultReactorBuilder(
public static @NonNull CustomCrossSourceStatementReactorBuilder defaultReactorBuilder(
final YangXPathParserFactory xpathFactory, final YangParserConfiguration config) {
- return addExtensions(vanillaReactorBuilder(xpathFactory, config), config);
- }
-
- private static @NonNull CustomCrossSourceStatementReactorBuilder addExtensions(
- final @NonNull CustomCrossSourceStatementReactorBuilder builder, final YangParserConfiguration config) {
- return builder
- // Semantic version support
- .addStatementSupport(ModelProcessingPhase.SOURCE_LINKAGE, new OpenConfigVersionSupport(config))
- .addNamespaceSupport(ModelProcessingPhase.SOURCE_LINKAGE, SemanticVersionNamespace.BEHAVIOUR)
- .addNamespaceSupport(ModelProcessingPhase.SOURCE_LINKAGE, SemanticVersionModuleNamespace.BEHAVIOUR)
- .addNamespaceSupport(ModelProcessingPhase.SOURCE_LINKAGE,
- ImportPrefixToSemVerSourceIdentifier.BEHAVIOUR);
+ return vanillaReactorBuilder(xpathFactory, config);
}
/**
private static @NonNull StatementSupportBundle fullDeclarationBundle(final StatementSupportBundle stmtDefBundle,
final XPathSupport xpathSupport, final YangParserConfiguration config) {
- final CaseStatementSupport rfc6020case = CaseStatementSupport.rfc6020Instance(config);
- final CaseStatementSupport rfc7950case = CaseStatementSupport.rfc7950Instance(config);
-
return StatementSupportBundle.derivedFrom(stmtDefBundle)
.addSupport(new LeafStatementSupport(config))
.addSupport(new ConfigStatementSupport(config))
.addSupport(new DeviationStatementSupport(config))
.addVersionSpecificSupport(VERSION_1, new DeviateStatementRFC6020Support(config))
.addVersionSpecificSupport(VERSION_1_1, new DeviateStatementRFC7950Support(config))
- .addVersionSpecificSupport(VERSION_1, ChoiceStatementSupport.rfc6020Instance(config, rfc6020case))
- .addVersionSpecificSupport(VERSION_1_1, ChoiceStatementSupport.rfc7950Instance(config, rfc7950case))
- .addVersionSpecificSupport(VERSION_1, rfc6020case)
- .addVersionSpecificSupport(VERSION_1_1, rfc7950case)
+ .addVersionSpecificSupport(VERSION_1, ChoiceStatementSupport.rfc6020Instance(config))
+ .addVersionSpecificSupport(VERSION_1_1, ChoiceStatementSupport.rfc7950Instance(config))
+ .addVersionSpecificSupport(VERSION_1, CaseStatementSupport.rfc6020Instance(config))
+ .addVersionSpecificSupport(VERSION_1_1, CaseStatementSupport.rfc7950Instance(config))
.addSupport(new MustStatementSupport(xpathSupport, config))
.addSupport(new MandatoryStatementSupport(config))
.addSupport(new AnyxmlStatementSupport(config))