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 com.google.common.base.Verify;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.yangtools.yang.model.api.meta.DeclaredStatement;
13 import org.opendaylight.yangtools.yang.model.api.meta.StatementDefinition;
14 import org.opendaylight.yangtools.yang.model.api.meta.StatementSource;
15 import org.opendaylight.yangtools.yang.parser.spi.meta.StmtContext;
18 * A base class for context-implied statements.
20 * @deprecated Use {@link AbstractUndeclaredEffectiveStatement} instead.
22 @Deprecated(forRemoval = true)
23 // FIXME: 6.0.0: remove this class
24 public abstract class UndeclaredEffectiveStatementBase<A, D extends DeclaredStatement<A>>
25 extends EffectiveStatementBase<A, D> {
27 private final @NonNull StatementSource statementSource;
28 private final @NonNull StatementDefinition statementDefinition;
29 private final A argument;
31 protected UndeclaredEffectiveStatementBase(final StmtContext<A, D, ?> ctx) {
33 this.statementDefinition = ctx.getPublicDefinition();
34 this.argument = ctx.getStatementArgument();
35 this.statementSource = ctx.getStatementSource();
37 final D declareInstance = ctx.buildDeclared();
38 Verify.verify(declareInstance == null, "Statement %s resulted in declared statement %s", declareInstance);
42 public final StatementDefinition statementDefinition() {
43 return statementDefinition;
47 public final A argument() {
52 public final StatementSource getStatementSource() {
53 return statementSource;
57 public final D getDeclared() {