Promote SchemaSourceRepresentation
[yangtools.git] / parser / yang-parser-api / src / main / java / org / opendaylight / yangtools / yang / parser / api / YangLibResolver.java
1 /*
2  * Copyright (c) 2022 PANTHEON.tech, 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.io.IOException;
12 import java.util.Collection;
13 import org.eclipse.jdt.annotation.NonNull;
14 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
15 import org.opendaylight.yangtools.yang.model.api.source.SourceRepresentation;
16
17 /**
18  * A service capable of transforming a {@link YangLibModuleSet} to an {@link EffectiveModelContext}.
19  */
20 @Beta
21 public interface YangLibResolver {
22     /**
23      * Return enumeration of concrete types of {@link SourceRepresentation} this resolver supports. Users can use this
24      * information prepare the source they have to a representation which will be accepted by this resolver.
25      *
26      * @return Enumeration of supported schema source representations.
27      */
28     @NonNull Collection<Class<? extends SourceRepresentation>> supportedSourceRepresentations();
29
30     /**
31      * Build the effective view of a combined view of effective statements.
32      *
33      * @return Effective module statements indexed by their QNameModule.
34      * @throws IOException if a module source cannot be read
35      * @throws YangSyntaxErrorException when a syntactic error is encountered
36      * @throws NullPointerException if {@code moduleSet} is {@code null}
37      * @throws IllegalArgumentException if {@code moduleSet} references an unsupported {@link SourceRepresentation}
38      */
39     @NonNull EffectiveModelContext resolveModuleSet(YangLibModuleSet moduleSet) throws IOException, YangParserException;
40 }