2 * Copyright (c) 2017 Pantheon Technologies, s.r.o. 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.impl;
10 import com.google.common.annotations.Beta;
11 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
12 import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor.Builder;
13 import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.YangInferencePipeline;
16 * Utility class for instantiating default-configured {@link CrossSourceStatementReactor}s.
18 * @author Robert Varga
21 public final class DefaultReactors {
22 private static final CrossSourceStatementReactor DEFAULT_REACTOR = createDefaultReactorBuilder().build();
24 private DefaultReactors() {
25 throw new UnsupportedOperationException();
29 * Get a shared default-configured reactor instance. This instance is configured to handle both RFC6020 and RFC7950,
30 * as well as RFC8040's yang-data extension.
32 * @return a shared default-configured reactor instance.
34 public static CrossSourceStatementReactor defaultReactor() {
35 return DEFAULT_REACTOR;
39 * Return a baseline CrossSourceStatementReactor {@link Builder}. The builder is initialized to the equivalent
40 * of the reactor returned via {@link #defaultReactor()}, but can be further customized before use.
42 * @return A populated CrossSourceStatementReactor builder.
44 public static Builder createDefaultReactorBuilder() {
45 // FIXME: customize with extensions
46 return YangInferencePipeline.newReactorBuilder();