Populate data/ hierarchy
[yangtools.git] / model / 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 java.util.Optional;
11 import org.eclipse.jdt.annotation.NonNull;
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 {@link EffectiveStatement}.
17  *
18  * <p>
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  * <p>
24  * Source: <a href="https://tools.ietf.org/html/rfc6020#section-6.3"> </a>
25  */
26 public interface StatementDefinition extends Immutable {
27     /**
28      * Returns name of the statement.
29      *
30      * @return Name of the statement
31      */
32     @NonNull QName getStatementName();
33
34     /**
35      * Returns name of statement argument or null, if statement does not have argument.
36      *
37      * @return argument name or null, if statement does not take argument.
38      */
39     @NonNull Optional<ArgumentDefinition> getArgumentDefinition();
40
41     /**
42      * Returns class which represents declared version of statement associated with this definition. This class should
43      * be an interface which provides convenience access to declared substatements.
44      *
45      * @return class which represents declared version of statement associated with this definition.
46      */
47     @NonNull Class<? extends DeclaredStatement<?>> getDeclaredRepresentationClass();
48
49     /**
50      * Returns class which represents derived behaviour from supplied statement. This class should be an interface which
51      * defines convenience access to statement properties, namespace items and substatements.
52      *
53      * @return class which represents effective version of statement associated with this definition
54      */
55     @NonNull Class<? extends EffectiveStatement<?, ?>> getEffectiveRepresentationClass();
56 }