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.rfc7950.stmt;
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
12 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
13 import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
14 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
16 public abstract class DeclaredEffectiveStatementBase<A, D extends DeclaredStatement<A>> extends
17 EffectiveStatementBase<A, D> {
19 private final @NonNull StatementSource statementSource;
20 private final A argument;
21 private final @NonNull D declaredInstance;
27 * context of statement.
29 protected DeclaredEffectiveStatementBase(final StmtContext<A, D, ?> ctx) {
31 argument = ctx.getStatementArgument();
32 statementSource = ctx.getStatementSource();
33 declaredInstance = ctx.buildDeclared();
37 public final StatementDefinition statementDefinition() {
38 return declaredInstance.statementDefinition();
47 public final StatementSource getStatementSource() {
48 return statementSource;
52 public final D getDeclared() {
53 return declaredInstance;