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