Populate xpath/ hierarchy
[yangtools.git] / parser / yang-parser-api / src / main / java / org / opendaylight / yangtools / yang / parser / api / YangParserFactory.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies, s.r.o. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.parser.api;
9
10 import com.google.common.annotations.Beta;
11 import java.util.Collection;
12 import org.eclipse.jdt.annotation.NonNull;
13
14 /**
15  * Basic entry point into a YANG parser implementation. Implementations of this interface are expected to be
16  * thread-safe.
17  */
18 public interface YangParserFactory {
19     /**
20      * Return enumeration of {@link ImportResolutionMode}s supported by this factory.
21      *
22      * @return Enumeration of supported schema source representations
23      */
24     @Beta
25     Collection<ImportResolutionMode> supportedImportResolutionModes();
26
27     /**
28      * Create a {@link YangParser} instance operating with default {@link YangParserConfiguration}.
29      *
30      * @return A new {@link YangParser} instance
31      */
32     default @NonNull YangParser createParser() {
33         return createParser(YangParserConfiguration.DEFAULT);
34     }
35
36     /**
37      * Create a {@link YangParser} instance operating with specified {@link YangParserConfiguration}.
38      *
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
43      */
44     @NonNull YangParser createParser(YangParserConfiguration configuration);
45 }