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 java.util.Collection;
11 import javax.annotation.Nonnull;
12 import javax.annotation.Nullable;
13 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
14 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
15 import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace;
16 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
17 import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
18 import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference;
21 public interface StmtContext<A,D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>> {
23 @Nonnull StatementSource getStatementSource();
25 @Nonnull StatementSourceReference getStatementSourceReference();
27 @Nonnull StatementDefinition getPublicDefinition();
29 @Nullable StmtContext<?,?,?> getParentContext();
31 @Nullable String rawStatementArgument();
33 @Nullable A getStatementArgument();
35 @Nonnull <K,VT, V extends VT,N extends IdentifierNamespace<K, V>> VT getFromNamespace(Class<N> type, K key) throws NamespaceNotAvailableException;
37 @Nonnull StmtContext<?,?,?> getRoot();
39 @Nonnull Collection<? extends StmtContext<?,?,?>> declaredSubstatements();
45 interface Mutable<A,D extends DeclaredStatement<A>,E extends EffectiveStatement<A, D>> extends StmtContext<A,D,E> {
48 StmtContext.Mutable<?,?,?> getParentContext();
50 <K,V,VT extends V,N extends IdentifierNamespace<K, V>> void addToNs(Class<N> type, K key, VT value) throws NamespaceNotAvailableException;
53 StmtContext.Mutable<?,?,?> getRoot();
55 ModelActionBuilder newInferenceAction(ModelProcessingPhase phase);
57 <K,KT extends K, N extends StatementNamespace<K, ?, ?>> void addContext(Class<N> namepsace, KT key,
58 StmtContext<?, ?, ?> stmt);