Add ability to get yang sources from SchemaContext.
[yangtools.git] / yang / yang-model-api / src / main / java / org / opendaylight / yangtools / yang / model / api / Module.java
1 /*
2  * Copyright (c) 2013 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;
9
10 import java.util.List;
11 import java.util.Set;
12
13 /**
14  * This interface contains the methods for getting the data from the YANG
15  * module.<br />
16  * <br />
17  * <i>Example of YANG module</i> <code><br/>
18  * {@link #getName() <b><font color="#FF0000">module</font></b>} module_name{<br />
19     &nbsp;&nbsp;{@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br /><br />
20
21     &nbsp;&nbsp;{@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br />
22     &nbsp;&nbsp;{@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br /><br />
23
24     &nbsp;&nbsp;{@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br />
25     &nbsp;&nbsp;{@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br /><br />
26
27     &nbsp;&nbsp;{@link #getOrganization() <b><font color="#606060">organization</font></b>} "John Doe, john.doe@email.com";<br />
28     &nbsp;&nbsp;{@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br /><br />
29
30     &nbsp;&nbsp;{@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br />
31     &nbsp;&nbsp;&nbsp;&nbsp; description "description of some feature";<br />
32     &nbsp;&nbsp;}</br>
33
34     &nbsp;&nbsp;{@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br />
35     &nbsp;&nbsp;{@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br />
36     <!-- &nbsp;&nbsp;{@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br /> -->
37     &nbsp;&nbsp;{@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br />
38     &nbsp;&nbsp;{@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br />
39
40
41     &nbsp;&nbsp;{@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br />
42
43     &nbsp;&nbsp;{@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br />
44     &nbsp;&nbsp;&nbsp;&nbsp;prefix "other_module_prefix"<br />
45     &nbsp;&nbsp;&nbsp;&nbsp;revision-date 2011-08-27<br />
46     &nbsp;&nbsp;}<br /><br />
47
48     &nbsp;&nbsp;container cont {<br />
49     &nbsp;&nbsp;}<br />
50
51     &nbsp;&nbsp;{@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br />
52     &nbsp;&nbsp;}<br />
53     }
54
55     </code>
56  */
57
58 public interface Module extends DataNodeContainer, SourceStreamAware, ModuleIdentifier {
59
60
61     /**
62      * Returns the prefix of the module
63      *
64      * @return string with the module prefix which is specified as argument of
65      *         YANG {@link Module <b><font color="#0000FF">prefix</font></b>}
66      *         keyword
67      */
68     String getPrefix();
69
70     /**
71      * Returns the YANG version.
72      *
73      * Default value is 1.
74      *
75      * @return string with the module YANG version which is specified as
76      *         argument of YANG {@link Module <b> <font
77      *         color="#8b4513">yang-version</font></b>} keyword
78      */
79     String getYangVersion();
80
81     /**
82      * Returns the module description.
83      *
84      * @return string with the module description which is specified as argument
85      *         of YANG {@link Module <b><font
86      *         color="#b8860b">description</font></b>} keyword
87      */
88     String getDescription();
89
90     /**
91      * Returns the module reference.
92      *
93      * @return string with the module reference which is specified as argument
94      *         of YANG {@link Module <b><font
95      *         color="#008b8b">reference</font></b>} keyword
96      */
97     String getReference();
98
99     /**
100      * Returns the module organization.
101      *
102      * @return string with the name of the organization specified in the module
103      *         as the argument of YANG {@link Module <b><font
104      *         color="#606060">organization</font></b>} keyword
105      */
106     String getOrganization();
107
108     /**
109      * Returns the module contact.
110      *
111      * The contact represents the person or persons to whom technical queries
112      * concerning this module should be sent, such as their name, postal
113      * address, telephone number, and electronic mail address.
114      *
115      * @return string with the contact data specified in the module as the
116      *         argument of YANG {@link Module <b><font
117      *         color="#FF9900">contact</font></b>} keyword
118      */
119     String getContact();
120
121     /**
122      * Returns imports which represents YANG modules which are imported to this
123      * module via <b>import</b> statement.
124      *
125      * @return set of module imports which are specified in the module as the
126      *         argument of YANG {@link Module <b><font
127      *         color="#9400d3">import</font></b>} keywords.
128      */
129     Set<ModuleImport> getImports();
130
131     /**
132      * Returns <code>FeatureDefinition</code> instances which contain data from
133      * <b>feature</b> statements defined in the module.
134      *
135      * The feature is used to define a mechanism by which portions of the schema
136      * are marked as conditional.
137      *
138      * @return feature statements in lexicographical order which are specified
139      *         in the module as the argument of YANG {@link Module <b><font
140      *         color="#8b0000">feature</font></b>} keywords.
141      */
142     Set<FeatureDefinition> getFeatures();
143
144     /**
145      * Returns <code>NotificationDefinition</code> instances which contain data
146      * from <b>notification</b> statements defined in the module.
147      *
148      * @return notification statements in lexicographical order which are
149      *         specified in the module as the argument of YANG {@link Module
150      *         <b><font color="#b22222">notification</font></b>} keywords.
151      */
152     Set<NotificationDefinition> getNotifications();
153
154     /**
155      * Returns <code>AugmentationSchema</code> instances which contain data from
156      * <b>augment</b> statements defined in the module.
157      *
158      * @return set of the augmentation schema instances which are specified in
159      *         the module as YANG {@link Module <b><font
160      *         color="#dc143c">augment</font></b>} keyword and are
161      *         lexicographicaly ordered
162      */
163     Set<AugmentationSchema> getAugmentations();
164
165     /**
166      * Returns <code>RpcDefinition</code> instances which contain data from
167      * <b>rpc</b> statements defined in the module.
168      *
169      * @return set of the rpc definition instances which are specified in the
170      *         module as YANG {@link Module <b><font
171      *         color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
172      *         ordered
173      */
174     Set<RpcDefinition> getRpcs();
175
176     /**
177      * Returns <code>Deviation</code> instances which contain data from
178      * <b>deviation</b> statements defined in the module.
179      *
180      * @return set of the deviation instances
181      */
182     Set<Deviation> getDeviations();
183
184     /**
185      * Returns <code>IdentitySchemaNode</code> instances which contain data from
186      * <b>identity</b> statements defined in the module.
187      *
188      * @return set of identity schema node instances which are specified in the
189      *         module as YANG {@link Module <b><font
190      *         color="#bdb76b">identity</font></b>} keywords and are
191      *         lexicographicaly ordered
192      */
193     Set<IdentitySchemaNode> getIdentities();
194
195     /**
196      * Returns <code>ExtensionDefinition</code> instances which contain data
197      * from <b>extension</b> statements defined in the module.
198      *
199      * @return set of extension definition instances which are specified in the
200      *         module as YANG {@link Module <b><font
201      *         color="#808000">extension</font></b>} keyword and are
202      *         lexicographicaly ordered
203      */
204     List<ExtensionDefinition> getExtensionSchemaNodes();
205
206     /**
207      * Returns unknown nodes defined in module.
208      *
209      * @return unknown nodes in lexicographical order
210      */
211     List<UnknownSchemaNode> getUnknownSchemaNodes();
212
213 }