2 * Copyright (c) 2022 PANTHEON.tech, 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.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;
18 * A service capable of transforming a {@link YangLibModuleSet} to an {@link EffectiveModelContext}.
21 public interface YangLibResolver {
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.
26 * @return Enumeration of supported schema source representations.
28 @NonNull Collection<Class<? extends SourceRepresentation>> supportedSourceRepresentations();
31 * Build the effective view of a combined view of effective statements.
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}
39 @NonNull EffectiveModelContext resolveModuleSet(YangLibModuleSet moduleSet) throws IOException, YangParserException;