7d4127b5478ca3dfb2cf143c7a1a7d4f67f1bb24
[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 javax.annotation.Nonnull;
11 import javax.annotation.Nullable;
12
13 /**
14  *
15  * Model statement
16  *
17  * There are two base types of model statements:
18  * <ul>
19  * <li>{@link DeclaredStatement} - Statement representation as was defined in original
20  * source. This representation could be used during computation of effective model
21  * or during transforming YANG model from one serialization format to other.
22  * </li>
23  * <li>
24  * {@link EffectiveStatement} - Representation of effective statement - this
25  * statement may be different from declared, in such way, that it contains additional
26  * substatements, provides access to model namespaces. Some effective statements may be not
27  * directly declared in YANG source, but could be inferred by semantic processing of
28  * other statements (eg. uses, augment).
29  * </li>
30  * </ul>
31  *
32  * @param <A> Argument type ({@link Void} if statement does not have argument.)
33  */
34 public interface ModelStatement<A> {
35
36     /**
37      * Statement Definition of this statement.
38      *
39      * @return definition of this statement.
40      */
41     @Nonnull StatementDefinition statementDefinition();
42
43     /**
44      *
45      * Returns statement argument
46      *
47      * @return statement argument or null if statement does not have argument.
48      */
49     @Nullable A argument();
50
51     /**
52      * Returns statement source, which denotes if statement was
53      * explicitly declared in original model or inferred during
54      * semantic processing of model.
55      *
56      * @return statement source.
57      */
58     @Nonnull StatementSource getStatementSource();
59
60 }