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.api;
10 import com.google.common.annotations.Beta;
11 import java.util.Collection;
12 import org.eclipse.jdt.annotation.NonNull;
15 * Basic entry point into a YANG parser implementation. Implementations of this interface are expected to be
18 public interface YangParserFactory {
20 * Return enumeration of {@link ImportResolutionMode}s supported by this factory.
22 * @return Enumeration of supported schema source representations
25 Collection<ImportResolutionMode> supportedImportResolutionModes();
28 * Create a {@link YangParser} instance operating with default {@link YangParserConfiguration}.
30 * @return A new {@link YangParser} instance
32 default @NonNull YangParser createParser() {
33 return createParser(YangParserConfiguration.DEFAULT);
37 * Create a {@link YangParser} instance operating with specified {@link YangParserConfiguration}.
39 * @param configuration Requested parser configuration
40 * @return A new {@link YangParser} instance
41 * @throws NullPointerException if configuration is null
42 * @throws IllegalArgumentException if specified configuration is not supported
44 @NonNull YangParser createParser(YangParserConfiguration configuration);