+ public static @NonNull CustomCrossSourceStatementReactorBuilder vanillaReactorBuilder(
+ final @NonNull YangXPathParserFactory xpathFactory) {
+ return vanillaReactorBuilder(new XPathSupport(xpathFactory));
+ }
+
+ private static @NonNull CustomCrossSourceStatementReactorBuilder vanillaReactorBuilder(
+ final @NonNull XPathSupport xpathSupport) {
+ final StatementSupportBundle fullDeclarationBundle = fullDeclarationBundle(xpathSupport);
+ return new CustomCrossSourceStatementReactorBuilder(SUPPORTED_VERSIONS)
+ .addAllSupports(ModelProcessingPhase.INIT, INIT_BUNDLE)
+ .addAllSupports(ModelProcessingPhase.SOURCE_PRE_LINKAGE, PRE_LINKAGE_BUNDLE)
+ .addAllSupports(ModelProcessingPhase.SOURCE_LINKAGE, LINKAGE_BUNDLE)
+ .addAllSupports(ModelProcessingPhase.STATEMENT_DEFINITION, STMT_DEF_BUNDLE)
+ .addAllSupports(ModelProcessingPhase.FULL_DECLARATION, fullDeclarationBundle)
+ .addAllSupports(ModelProcessingPhase.EFFECTIVE_MODEL, fullDeclarationBundle)
+ .addValidationBundle(ValidationBundleType.SUPPORTED_REFINE_SUBSTATEMENTS,
+ YangValidationBundles.SUPPORTED_REFINE_SUBSTATEMENTS)
+ .addValidationBundle(ValidationBundleType.SUPPORTED_AUGMENT_TARGETS,
+ YangValidationBundles.SUPPORTED_AUGMENT_TARGETS)
+
+ // FIXME: 7.0.0: we do not seem to need this validation bundle
+ .addValidationBundle(ValidationBundleType.SUPPORTED_CASE_SHORTHANDS,
+ YangValidationBundles.SUPPORTED_CASE_SHORTHANDS)
+
+ .addValidationBundle(ValidationBundleType.SUPPORTED_DATA_NODES,
+ YangValidationBundles.SUPPORTED_DATA_NODES);
+ }
+
+ private static @NonNull StatementSupportBundle fullDeclarationBundle(final XPathSupport xpathSupport) {
+ return StatementSupportBundle
+ .derivedFrom(STMT_DEF_BUNDLE)
+ .addSupport(LeafStatementSupport.getInstance())
+ .addSupport(ConfigStatementSupport.getInstance())
+ .addSupport(DeviationStatementSupport.getInstance())
+ .addVersionSpecificSupport(VERSION_1, DeviateStatementRFC6020Support.getInstance())
+ .addVersionSpecificSupport(VERSION_1_1, DeviateStatementRFC7950Support.getInstance())
+ .addVersionSpecificSupport(VERSION_1, ChoiceStatementSupport.rfc6020Instance())
+ .addVersionSpecificSupport(VERSION_1_1, ChoiceStatementSupport.rfc7950Instance())
+ .addVersionSpecificSupport(VERSION_1, CaseStatementSupport.rfc6020Instance())
+ .addVersionSpecificSupport(VERSION_1_1, CaseStatementSupport.rfc7950Instance())
+ .addSupport(MustStatementSupport.createInstance(xpathSupport))
+ .addSupport(MandatoryStatementSupport.getInstance())
+ .addSupport(AnyxmlStatementSupport.getInstance())
+ .addVersionSpecificSupport(VERSION_1_1, AnydataStatementSupport.getInstance())
+ .addSupport(FeatureNamespace.BEHAVIOUR)
+ .addVersionSpecificSupport(VERSION_1, IfFeatureStatementRFC6020Support.getInstance())
+ .addVersionSpecificSupport(VERSION_1_1, IfFeatureStatementRFC7950Support.getInstance())
+ .addSupport(GroupingNamespace.BEHAVIOUR)
+ .addSupport(SourceGroupingNamespace.BEHAVIOUR)
+ .addSupport(UsesStatementSupport.getInstance())
+ .addSupport(ErrorMessageStatementSupport.getInstance())
+ .addSupport(ErrorAppTagStatementSupport.getInstance())
+ .addVersionSpecificSupport(VERSION_1, LeafListStatementSupport.rfc6020Instance())
+ .addVersionSpecificSupport(VERSION_1_1, LeafListStatementSupport.rfc7950Instance())
+ .addSupport(PresenceStatementSupport.getInstance())
+ .addSupport(MaxElementsStatementSupport.getInstance())
+ .addSupport(MinElementsStatementSupport.getInstance())
+ .addSupport(OrderedByStatementSupport.getInstance())
+ .addSupport(WhenStatementSupport.createInstance(xpathSupport))
+ .addSupport(AugmentImplicitHandlingNamespace.BEHAVIOUR)
+ .addVersionSpecificSupport(VERSION_1, AugmentStatementRFC6020Support.getInstance())
+ .addVersionSpecificSupport(VERSION_1_1, AugmentStatementRFC7950Support.getInstance())
+ .addSupport(RefineTargetNamespace.BEHAVIOUR)
+ .addVersionSpecificSupport(VERSION_1, RefineStatementSupport.rfc6020Instance())
+ .addVersionSpecificSupport(VERSION_1_1, RefineStatementSupport.rfc7950Instance())
+ .addSupport(FeatureStatementSupport.getInstance())
+ .addSupport(PositionStatementSupport.getInstance())
+ .addSupport(ValueStatementSupport.getInstance())
+ .addSupport(YangNamespaceContextNamespace.BEHAVIOUR)
+ .build();