2 * Copyright (c) 2020 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.yang2sources.spi;
10 import com.google.common.annotations.Beta;
11 import java.util.Optional;
12 import org.opendaylight.yangtools.yang.model.api.ModuleLike;
13 import org.opendaylight.yangtools.yang.model.repo.api.SchemaSourceRepresentation;
16 * An SPI-level interface to find the schema source for a particular YANG module, as packaged in the final artifact.
17 * The module must be part of the current resolution context.
21 public interface ModuleResourceResolver {
23 * Find the path of the packaged resource which corresponds to the specified module in the specified representation.
25 * @param module Requested module
26 * @param representation Requested representation
27 * @return Path to packaged resource
28 * @throws NullPointerException if any argument is null
29 * @throws IllegalArgumentException if the requested representation is not supported by this resolver
31 Optional<String> findModuleResourcePath(ModuleLike module,
32 Class<? extends SchemaSourceRepresentation> representation);