2 * Copyright (c) 2017 Pantheon Technologies, 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.model.api.stmt;
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.common.QNameModule;
13 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
14 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
17 public interface ModuleEffectiveStatement extends EffectiveStatement<String, ModuleStatement> {
19 * Namespace mapping all known prefixes in a module to their modules. Note this namespace includes the module
20 * in which it is instantiated.
22 abstract class PrefixToEffectiveModuleNamespace
23 implements IdentifierNamespace<String, @NonNull ModuleEffectiveStatement> {
24 private PrefixToEffectiveModuleNamespace() {
25 // This class should never be subclassed
30 * Namespace mapping all known {@link QNameModule}s to their encoding prefixes. This includes the declaration
31 * from prefix/namespace/revision and all imports as they were resolved.
33 abstract class QNameModuleToPrefixNamespace implements IdentifierNamespace<QNameModule, @NonNull String> {
34 private QNameModuleToPrefixNamespace() {
35 // This class should never be subclassed
40 * Namespace mapping all included submodules. The namespaces is keyed by submodule name.
42 abstract class NameToEffectiveSubmoduleNamespace
43 implements IdentifierNamespace<String, @NonNull SubmoduleEffectiveStatement> {
44 private NameToEffectiveSubmoduleNamespace() {
45 // This class should never be subclassed
50 * Get the local QNameModule of this module. All implementations need to override this default method.
52 * @return Local QNameModule
54 // FIXME: 3.0.0 make this method non-default
55 default @NonNull QNameModule localQNameModule() {
56 throw new UnsupportedOperationException(getClass() + " is missing an implementation");