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.rfc6020.effective;
10 import com.google.common.base.Verify;
11 import javax.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;
17 public abstract class UndeclaredEffectiveStatementBase<A, D extends DeclaredStatement<A>> extends EffectiveStatementBase<A, D> {
19 private final StatementSource statementSource;
20 private final StatementDefinition statementDefinition;
21 private final A argument;
23 protected UndeclaredEffectiveStatementBase(final StmtContext<A, D, ?> ctx) {
25 this.statementDefinition = ctx.getPublicDefinition();
26 this.argument = ctx.getStatementArgument();
27 this.statementSource = ctx.getStatementSource();
29 final D declareInstance = ctx.buildDeclared();
30 Verify.verify(declareInstance == null, "Statement %s resulted in declared statement %s", declareInstance);
35 public final StatementDefinition statementDefinition() {
36 return statementDefinition;
40 public final A argument() {
46 public final StatementSource getStatementSource() {
47 return statementSource;
51 public final D getDeclared() {