2 * Copyright (c) 2015 Cisco Systems, Inc. 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.spi.meta;
10 import com.google.common.annotations.Beta;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.common.QName;
13 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
16 * Module-specific namespace for holding {@link StatementDefinition}s defined by extension statements. This namespace
17 * is populated before full declaration phase.
19 * @author Robert Varga
21 // FIXME: 8.0.0: Fix naming and javadoc of this namespace.
23 // We have three competing namespaces dealing with various things and the interaction is no entirely clear:
24 // - ExtensionNamespace, which is populated by ExtensionStatementSupport for all extensions with the corresponding
25 // effective statement and used by SubstatementValidator
26 // - StatementDefinitionNamespace (this), which is again populated by ExtensionStatementSupport to point to unrecognized
27 // statement support, i.e. preventing instantiation, and is used only by
28 // reactor's SourceSpecificContext
29 // - StatementSupportNamespace, which is a virtual namespace providing access to StatementSupport instances for all
30 // statements available in current processing phase of the source. It works as a union of
31 // this namespace (StatementDefinitionNamespace) and the contents of
32 // StatementSupportBundles.
34 // At the end of the day this feels like an under-utilized namespace: provided the contents of ExtensionNamespace and
35 // StatementSupportBundles, SourceSpecificSpecificContext should be able to work its magic even without this namespace.
37 public interface StatementDefinitionNamespace extends ParserNamespace<QName, StatementSupport<?, ?, ?>> {
38 NamespaceBehaviour<QName, StatementSupport<?, ?, ?>, @NonNull StatementDefinitionNamespace> BEHAVIOUR =
39 NamespaceBehaviour.global(StatementDefinitionNamespace.class);