Populate data/ hierarchy
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / meta / ModelStatement.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.yangtools.yang.model.api.meta;
9
10 import org.eclipse.jdt.annotation.NonNull;
11 import org.opendaylight.yangtools.yang.common.Empty;
12
13 /**
14  * Model statement. There are two base types of model statements:
15  * <ul>
16  *   <li>{@link DeclaredStatement} - Statement representation as was defined in original source. This representation
17  *       could be used during computation of effective model or during transforming YANG model from one serialization
18  *       format to another.
19  *   </li>
20  *   <li>{@link EffectiveStatement} - Representation of effective statement - this statement may be different from
21  *       declared, in such way, that it contains additional substatements, provides access to model namespaces. Some
22  *       effective statements may be not directly declared in YANG source, but could be inferred by semantic processing
23  *       of other statements (for example {@code uses}, {@code augment} and others).
24  *   </li>
25  * </ul>
26  *
27  * @param <A> Argument type ({@link Empty} if statement does not have argument.)
28  */
29 public interface ModelStatement<A> {
30     /**
31      * Statement Definition of this statement.
32      *
33      * @return definition of this statement.
34      */
35     @NonNull StatementDefinition statementDefinition();
36
37     /**
38      * Returns statement argument.
39      *
40      * @return statement argument.
41      */
42     @NonNull A argument();
43
44     /**
45      * Returns {@link StatementOrigin}, which denotes if statement was explicitly declared in original model or inferred
46      * during semantic processing of model.
47      *
48      * @return statement origin.
49      */
50     @NonNull StatementOrigin statementOrigin();
51 }