public CustomCrossSourceStatementReactorBuilder addAllSupports(final ModelProcessingPhase phase, final StatementSupportBundle stmtSupportBundle) { addAllCommonStatementSupports(phase, stmtSupportBundle.getCommonDefinitions().values()); addAllVersionSpecificSupports(phase, stmtSupportBundle.getAllVersionSpecificDefinitions()); addAllNamespaceSupports(phase, stmtSupportBundle.getNamespaceDefinitions().values()); return this; }
private QNameToStatementDefinition stmtDef() { // regular YANG statements and extension supports added final StatementSupportBundle supportsForPhase = currentContext.getSupportsForPhase(inProgressPhase); qnameToStmtDefMap.putAll(supportsForPhase.getCommonDefinitions()); qnameToStmtDefMap.putAll(supportsForPhase.getDefinitionsSpecificForVersion(getRootVersion())); // No further actions needed if (inProgressPhase != ModelProcessingPhase.FULL_DECLARATION) { return qnameToStmtDefMap; } // We need to any and all extension statements which have been declared in the context final Map<QName, StatementSupport<?, ?, ?>> extensions = currentContext.getAllFromNamespace( StatementDefinitionNamespace.class); if (extensions != null) { extensions.forEach((qname, support) -> { final StatementSupport<?, ?, ?> existing = qnameToStmtDefMap.putIfAbsent(qname, support); if (existing != null) { LOG.debug("Source {} already defines statement {} as {}", source, qname, existing); } else { LOG.debug("Source {} defined statement {} as {}", source, qname, support); } }); } return qnameToStmtDefMap; }