2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.yang.parser.stmt.rfc6020;
10 import static org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.global;
11 import static org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.sourceLocal;
13 import com.google.common.collect.ImmutableMap;
15 import org.opendaylight.yangtools.yang.parser.spi.ModuleNamespace;
16 import org.opendaylight.yangtools.yang.parser.spi.NamespaceToModule;
17 import org.opendaylight.yangtools.yang.parser.spi.meta.ModelProcessingPhase;
18 import org.opendaylight.yangtools.yang.parser.spi.meta.StatementSupportBundle;
19 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
21 public final class YangInferencePipeline {
23 public static final StatementSupportBundle LINKAGE_BUNDLE = StatementSupportBundle.builder()
24 .addSupport(new ModuleStatementSupport())
25 .addSupport(new NamespaceStatementImpl.Definition())
26 .addSupport(new ImportStatementDefinition())
27 .addSupport(new PrefixStatementImpl.Definition())
28 .addSupport(global(ModuleNamespace.class))
29 .addSupport(global(NamespaceToModule.class))
30 .addSupport(sourceLocal(ImportedModuleContext.class))
33 private static final StatementSupportBundle STMT_DEF_BUNDLE = StatementSupportBundle.derivedFrom(LINKAGE_BUNDLE).build();
35 private static final StatementSupportBundle FULL_DECL_BUNDLE = StatementSupportBundle.derivedFrom(STMT_DEF_BUNDLE).build();
37 public static final Map<ModelProcessingPhase, StatementSupportBundle> RFC6020_BUNDLES = ImmutableMap
38 .<ModelProcessingPhase, StatementSupportBundle> builder()
39 .put(ModelProcessingPhase.SOURCE_LINKAGE, LINKAGE_BUNDLE)
40 .put(ModelProcessingPhase.STATEMENT_DEFINITION,STMT_DEF_BUNDLE)
41 .put(ModelProcessingPhase.FULL_DECLARATION,FULL_DECL_BUNDLE)
42 .put(ModelProcessingPhase.EFFECTIVE_MODEL,FULL_DECL_BUNDLE)
45 public static final CrossSourceStatementReactor RFC6020_REACTOR = CrossSourceStatementReactor.builder()
46 .setBundle(ModelProcessingPhase.SOURCE_LINKAGE, LINKAGE_BUNDLE)
47 .setBundle(ModelProcessingPhase.STATEMENT_DEFINITION,STMT_DEF_BUNDLE)
48 .setBundle(ModelProcessingPhase.FULL_DECLARATION,FULL_DECL_BUNDLE)
49 .setBundle(ModelProcessingPhase.EFFECTIVE_MODEL,FULL_DECL_BUNDLE)
52 private YangInferencePipeline() {
53 throw new UnsupportedOperationException("Utility class");