/* * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ package org.opendaylight.yangtools.yang.parser.spi.meta; import java.util.List; import java.util.Map; import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.parser.spi.source.SourceException; import org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase; import java.util.Collection; import javax.annotation.Nonnull; import javax.annotation.Nullable; import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement; import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement; import org.opendaylight.yangtools.yang.model.api.meta.IdentifierNamespace; import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition; import org.opendaylight.yangtools.yang.model.api.meta.StatementSource; import org.opendaylight.yangtools.yang.parser.spi.source.StatementSourceReference; public interface StmtContext, E extends EffectiveStatement> { @Nonnull StatementSource getStatementSource(); @Nonnull StatementSourceReference getStatementSourceReference(); @Nonnull StatementDefinition getPublicDefinition(); @Nullable StmtContext getParentContext(); @Nullable String rawStatementArgument(); @Nullable A getStatementArgument(); @Nullable List getArgumentsFromRoot(); //> // > VT getFromNamespace(Class type, K key) @Nonnull > V getFromNamespace(Class type, K key) throws NamespaceNotAvailableException; > Map getAllFromNamespace(Class type); @Nonnull StmtContext getRoot(); @Nonnull Collection> declaredSubstatements(); public Collection> effectiveSubstatements(); D buildDeclared(); E buildEffective(); public StatementContextBase createCopy(QNameModule newQNameModule,StatementContextBase newParent) throws SourceException; interface Mutable,E extends EffectiveStatement> extends StmtContext { @Override StmtContext.Mutable getParentContext(); //> void addToNs(Class type, K key, VT value) > void addToNs(Class type, K key, VT value) throws NamespaceNotAvailableException; @Override StmtContext.Mutable getRoot(); ModelActionBuilder newInferenceAction(ModelProcessingPhase phase); > void addContext(Class namespace, KT key, StmtContext stmt); } }