Refactor DOMYangTextSourceProvider
[mdsal.git] / binding / mdsal-binding-runtime-api / src / main / java / org / opendaylight / mdsal / binding / runtime / api / ModuleInfoSnapshot.java
1 /*
2  * Copyright (c) 2020 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.mdsal.binding.runtime.api;
9
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNullByDefault;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yangtools.concepts.Immutable;
14 import org.opendaylight.yangtools.yang.binding.YangModuleInfo;
15 import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
16 import org.opendaylight.yangtools.yang.model.api.source.SourceIdentifier;
17 import org.opendaylight.yangtools.yang.model.api.source.YangTextSource;
18 import org.opendaylight.yangtools.yang.model.repo.api.MissingSchemaSourceException;
19
20 /**
21  * A snapshot of a set of {@link YangModuleInfo}s, assembled to form an {@link EffectiveModelContext}.
22  */
23 @Beta
24 @NonNullByDefault
25 public interface ModuleInfoSnapshot extends Immutable {
26     /**
27      * The {@link EffectiveModelContext} resulting from all models exposed from constituent module infos.
28      *
29      * @return the resulting model context
30      */
31     EffectiveModelContext modelContext();
32
33     @Nullable YangTextSource yangTextSource(SourceIdentifier sourceId);
34
35     YangTextSource getYangTextSource(SourceIdentifier sourceId) throws MissingSchemaSourceException;
36
37     <T> Class<T> loadClass(String fullyQualifiedName) throws ClassNotFoundException;
38 }