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.stmt.reactor;
10 import com.google.common.base.Preconditions;
11 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
12 import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement;
13 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.NamespaceStorageNode;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.NamespaceBehaviour.Registry;
15 import org.opendaylight.yangtools.yang.parser.spi.source.SourceException;
17 class SubstatementContext<A,D extends DeclaredStatement<A>, E extends EffectiveStatement<A, D>>
18 extends StatementContextBase<A,D,E> {
20 private final StatementContextBase<?,?,?> parent;
22 SubstatementContext(StatementContextBase<?,?,?> parent,ContextBuilder<A,D,E> builder) throws SourceException {
24 this.parent = Preconditions.checkNotNull(parent, "Parent must not be null");
28 public StatementContextBase<?,?,?> getParentContext() {
33 public NamespaceStorageNode getParentNamespaceStorage() {
38 public Registry getBehaviourRegistry() {
39 return parent.getBehaviourRegistry();
43 public RootStatementContext<?, ?, ?> getRoot() {
44 return parent.getRoot();