ac2293d165b9dbb0b588a665adb8f228b417a613
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / meta / StatementDefinition.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 import org.opendaylight.yangtools.concepts.Immutable;
13 import org.opendaylight.yangtools.yang.common.QName;
14
15 /**
16  * Definition / model of YANG {@link DeclaredStatement} and
17  * {@link EffectiveStatement}.
18  *
19  * Statement concept is defined in RFC6020 section 6.3: <blockquote> A YANG
20  * module contains a sequence of statements. Each statement starts with a
21  * keyword, followed by zero or one argument </blockquote>
22  *
23  * Source: <a href="https://tools.ietf.org/html/rfc6020#section-6.3"> </a>
24  */
25 public interface StatementDefinition extends Immutable {
26     /**
27      * Returns name of the statement
28      *
29      * @return Name of the statement
30      */
31     @Nonnull
32     QName getStatementName();
33
34     /**
35      * Returns name of statement argument or null, if statement does not have
36      * argument.
37      *
38      * @return argument name or null, if statement does not take argument.
39      */
40     @Nullable
41     QName getArgumentName();
42
43     /**
44      * Returns class which represents declared version of statement associated
45      * with this definition.
46      *
47      * This class should be interface, which provides convenience access to
48      * declared substatements.
49      *
50      * @return class which represents declared version of statement associated
51      *         with this definition.
52      */
53     @Nonnull
54     Class<? extends DeclaredStatement<?>> getDeclaredRepresentationClass();
55
56     /**
57      * Returns class which represents derived behaviour from supplied statement.
58      *
59      * This class should be interface, which defines convenience access to
60      * statement properties, namespace items and substatements.
61      *
62      * @return class which represents effective version of statement associated
63      *         with this definition
64      */
65     @Nonnull
66     Class<? extends EffectiveStatement<?, ?>> getEffectiveRepresentationClass();
67
68     /**
69      * Returns true, if argument of statement is represented as value of yin
70      * element. If argument of statement is represented as argument of yin
71      * element, returns false.
72      *
73      *
74      * @return returns true, if statement argument is represented as value of
75      *         yin element, otherwise returns false.
76      */
77     boolean isArgumentYinElement();
78 }