import org.opendaylight.yangtools.yang.parser.spi.source.ModuleNameToNamespace;
import org.opendaylight.yangtools.yang.parser.spi.source.ModuleNamespaceForBelongsTo;
import org.opendaylight.yangtools.yang.parser.spi.source.ModuleQNameToModuleName;
+import org.opendaylight.yangtools.yang.parser.spi.source.ModulesDeviatedByModules;
import org.opendaylight.yangtools.yang.parser.spi.source.PrefixToModule;
import org.opendaylight.yangtools.yang.parser.spi.source.QNameToStatementDefinition;
import org.opendaylight.yangtools.yang.parser.spi.source.StmtOrderingNamespace;
import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.OutputStatementRfc7950Support;
import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.PatternStatementRfc7950Support;
import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.RefineStatementRfc7950Support;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.RpcStatementRfc7950Support;
import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.SubmoduleStatementRfc7950Support;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc7950.TypeStatementRfc7950Support;
+import org.opendaylight.yangtools.yang.parser.stmt.rfc8040.YangDataStatementSupport;
public final class YangInferencePipeline {
public static final Set<YangVersion> SUPPORTED_VERSIONS = Sets.immutableEnumSet(VERSION_1, VERSION_1_1);
public static final StatementSupportBundle INIT_BUNDLE = StatementSupportBundle
.builder(SUPPORTED_VERSIONS).addSupport(global(ValidationBundlesNamespace.class))
.addSupport(global(SupportedFeaturesNamespace.class))
+ .addSupport(global(ModulesDeviatedByModules.class))
.build();
public static final StatementSupportBundle PRE_LINKAGE_BUNDLE = StatementSupportBundle
.addVersionSpecificSupport(VERSION_1_1, new ImportStatementRfc7950Support())
.addVersionSpecificSupport(VERSION_1, new IncludeStatementImpl.Definition())
.addVersionSpecificSupport(VERSION_1_1, new IncludeStatementRfc7950Support())
+ .addSupport(new BelongsToStatementImpl.Definition())
.addSupport(new PrefixStatementImpl.Definition())
.addSupport(new YangVersionStatementImpl.Definition())
.addSupport(new RevisionStatementImpl.Definition())
.addSupport(new ReferenceStatementImpl.Definition())
.addSupport(new ContactStatementImpl.Definition())
.addSupport(new OrganizationStatementImpl.Definition())
- .addSupport(new BelongsToStatementImpl.Definition())
.addSupport(global(ModuleNamespace.class))
.addSupport(global(ModuleNamespaceForBelongsTo.class))
.addSupport(global(SubmoduleNamespace.class))
.addSupport(sourceLocal(BelongsToModuleContext.class))
.addSupport(sourceLocal(QNameToStatementDefinition.class))
.addSupport(sourceLocal(BelongsToPrefixToModuleName.class))
- .addSupport(new SemanticVersionStatementImpl.SemanticVersionSupport())
+ .addSupport(new OpenconfigVersionStatementImpl.OpenconfigVersionSupport())
.addSupport(global(SemanticVersionNamespace.class))
.addSupport(global(SemanticVersionModuleNamespace.class))
.addSupport(sourceLocal(ImpPrefixToSemVerModuleIdentifier.class))
.addSupport(global(IdentityNamespace.class))
.addSupport(new DefaultStatementImpl.Definition())
.addSupport(new StatusStatementImpl.Definition())
- .addSupport(new TypeStatementImpl.Definition())
+ .addVersionSpecificSupport(VERSION_1, new TypeStatementImpl.Definition())
+ .addVersionSpecificSupport(VERSION_1_1, new TypeStatementRfc7950Support())
.addSupport(new UnitsStatementImpl.Definition())
.addSupport(new RequireInstanceStatementImpl.Definition())
.addVersionSpecificSupport(VERSION_1, new BitStatementImpl.Definition())
.addVersionSpecificSupport(VERSION_1_1, new ListStatementRfc7950Support())
.addSupport(new UniqueStatementImpl.Definition())
.addVersionSpecificSupport(VERSION_1_1, new ActionStatementImpl.Definition())
- .addSupport(new RpcStatementImpl.Definition())
+ .addVersionSpecificSupport(VERSION_1, new RpcStatementImpl.Definition())
+ .addVersionSpecificSupport(VERSION_1_1, new RpcStatementRfc7950Support())
.addVersionSpecificSupport(VERSION_1, new InputStatementImpl.Definition())
.addVersionSpecificSupport(VERSION_1_1, new InputStatementRfc7950Support())
.addVersionSpecificSupport(VERSION_1, new OutputStatementImpl.Definition())
.addSupport(new ValueStatementImpl.Definition())
.addSupport(new AnyxmlSchemaLocationStatementImpl.AnyxmlSchemaLocationSupport())
.addSupport(treeScoped(AnyxmlSchemaLocationNamespace.class))
+ .addSupport(YangDataStatementSupport.getInstance())
.addSupport(global(StmtOrderingNamespace.class))
.build();
- public static final Map<ModelProcessingPhase, StatementSupportBundle> RFC6020_BUNDLES = ImmutableMap
- .<ModelProcessingPhase, StatementSupportBundle> builder()
+ public static final Map<ModelProcessingPhase, StatementSupportBundle> RFC6020_BUNDLES =
+ ImmutableMap.<ModelProcessingPhase, StatementSupportBundle>builder()
.put(ModelProcessingPhase.INIT, INIT_BUNDLE)
.put(ModelProcessingPhase.SOURCE_PRE_LINKAGE, PRE_LINKAGE_BUNDLE)
.put(ModelProcessingPhase.SOURCE_LINKAGE, LINKAGE_BUNDLE)
.put(ModelProcessingPhase.EFFECTIVE_MODEL, FULL_DECL_BUNDLE)
.build();
- public static final Map<ValidationBundleType, Collection<StatementDefinition>> RFC6020_VALIDATION_BUNDLE = ImmutableMap
- .<ValidationBundleType, Collection<StatementDefinition>> builder()
- .put(ValidationBundleType.SUPPORTED_REFINE_SUBSTATEMENTS, YangValidationBundles.SUPPORTED_REFINE_SUBSTATEMENTS)
+ public static final Map<ValidationBundleType, Collection<StatementDefinition>> RFC6020_VALIDATION_BUNDLE =
+ ImmutableMap.<ValidationBundleType, Collection<StatementDefinition>>builder()
+ .put(ValidationBundleType.SUPPORTED_REFINE_SUBSTATEMENTS,
+ YangValidationBundles.SUPPORTED_REFINE_SUBSTATEMENTS)
.put(ValidationBundleType.SUPPORTED_AUGMENT_TARGETS, YangValidationBundles.SUPPORTED_AUGMENT_TARGETS)
.put(ValidationBundleType.SUPPORTED_CASE_SHORTHANDS, YangValidationBundles.SUPPORTED_CASE_SHORTHANDS)
.put(ValidationBundleType.SUPPORTED_DATA_NODES, YangValidationBundles.SUPPORTED_DATA_NODES)
.build();
- public static final CrossSourceStatementReactor RFC6020_REACTOR = CrossSourceStatementReactor
- .builder()
+ public static final CrossSourceStatementReactor RFC6020_REACTOR = CrossSourceStatementReactor.builder()
.setBundle(ModelProcessingPhase.INIT, INIT_BUNDLE)
.setBundle(ModelProcessingPhase.SOURCE_PRE_LINKAGE, PRE_LINKAGE_BUNDLE)
.setBundle(ModelProcessingPhase.SOURCE_LINKAGE, LINKAGE_BUNDLE)
- .setBundle(ModelProcessingPhase.STATEMENT_DEFINITION,
- STMT_DEF_BUNDLE)
+ .setBundle(ModelProcessingPhase.STATEMENT_DEFINITION, STMT_DEF_BUNDLE)
.setBundle(ModelProcessingPhase.FULL_DECLARATION, FULL_DECL_BUNDLE)
.setBundle(ModelProcessingPhase.EFFECTIVE_MODEL, FULL_DECL_BUNDLE)
- .setValidationBundle(
- ValidationBundleType.SUPPORTED_REFINE_SUBSTATEMENTS,
+ .setValidationBundle(ValidationBundleType.SUPPORTED_REFINE_SUBSTATEMENTS,
YangValidationBundles.SUPPORTED_REFINE_SUBSTATEMENTS)
.setValidationBundle(ValidationBundleType.SUPPORTED_AUGMENT_TARGETS,
YangValidationBundles.SUPPORTED_AUGMENT_TARGETS)