2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.yangtools.yang.model.api;
10 import java.util.List;
12 import javax.annotation.Nullable;
13 import javax.annotation.concurrent.Immutable;
16 * This interface contains the methods for getting the data from the YANG
19 * <i>Example of YANG module</i> <code><br>
20 * {@link #getName() <b><font color="#FF0000">module</font></b>} module_name{<br>
21 {@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br><br>
23 {@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br>
24 {@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br><br>
26 {@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br>
27 {@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br><br>
29 {@link #getOrganization() <b><font color="#606060">organization</font></b>} "John Doe, john.doe@email.com";<br>
30 {@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br><br>
32 {@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br>
33 description "description of some feature";<br>
36 {@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br>
37 {@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br>
38 <!-- {@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br> -->
39 {@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br>
40 {@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br>
43 {@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br>
45 {@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br>
46 prefix "other_module_prefix"<br>
47 revision-date 2011-08-27<br>
50 container cont {<br>
53 {@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br>
60 public interface Module extends DataNodeContainer, SourceStreamAware, ModuleIdentifier {
62 * Returns the prefix of the module
64 * @return string with the module prefix which is specified as argument of
65 * YANG {@link Module <b><font color="#0000FF">prefix</font></b>}
71 * Returns the YANG version.
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
79 String getYangVersion();
82 * Returns the module description.
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
88 String getDescription();
91 * Returns the module reference.
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
97 String getReference();
100 * Returns the module organization.
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
106 String getOrganization();
109 * Returns the module contact.
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.
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
122 * Returns imports which represents YANG modules which are imported to this
123 * module via <b>import</b> statement.
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.
129 Set<ModuleImport> getImports();
131 Set<Module> getSubmodules();
134 * Returns <code>FeatureDefinition</code> instances which contain data from
135 * <b>feature</b> statements defined in the module.
137 * The feature is used to define a mechanism by which portions of the schema
138 * are marked as conditional.
140 * @return feature statements in lexicographical order which are specified
141 * in the module as the argument of YANG {@link Module <b><font
142 * color="#8b0000">feature</font></b>} keywords.
144 Set<FeatureDefinition> getFeatures();
147 * Returns <code>NotificationDefinition</code> instances which contain data
148 * from <b>notification</b> statements defined in the module.
150 * @return notification statements in lexicographical order which are
151 * specified in the module as the argument of YANG {@link Module
152 * <b><font color="#b22222">notification</font></b>} keywords.
154 Set<NotificationDefinition> getNotifications();
157 * Returns <code>AugmentationSchema</code> instances which contain data from
158 * <b>augment</b> statements defined in the module.
160 * @return set of the augmentation schema instances which are specified in
161 * the module as YANG {@link Module <b><font
162 * color="#dc143c">augment</font></b>} keyword and are
163 * lexicographically ordered
165 Set<AugmentationSchema> getAugmentations();
168 * Returns <code>RpcDefinition</code> instances which contain data from
169 * <b>rpc</b> statements defined in the module.
171 * @return set of the rpc definition instances which are specified in the
172 * module as YANG {@link Module <b><font
173 * color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
176 Set<RpcDefinition> getRpcs();
179 * Returns <code>Deviation</code> instances which contain data from
180 * <b>deviation</b> statements defined in the module.
182 * @return set of the deviation instances
184 Set<Deviation> getDeviations();
187 * Returns <code>IdentitySchemaNode</code> instances which contain data from
188 * <b>identity</b> statements defined in the module.
190 * @return set of identity schema node instances which are specified in the
191 * module as YANG {@link Module <b><font
192 * color="#bdb76b">identity</font></b>} keywords and are
193 * lexicographically ordered
195 Set<IdentitySchemaNode> getIdentities();
198 * Returns <code>ExtensionDefinition</code> instances which contain data
199 * from <b>extension</b> statements defined in the module.
201 * @return set of extension definition instances which are specified in the
202 * module as YANG {@link Module <b><font
203 * color="#808000">extension</font></b>} keyword and are
204 * lexicographically ordered
206 List<ExtensionDefinition> getExtensionSchemaNodes();
209 * Returns unknown nodes defined in module.
211 * @return unknown nodes in lexicographical order
213 List<UnknownSchemaNode> getUnknownSchemaNodes();
218 * @return YANG text of this module, or null if the source is not available.
219 * @deprecated Use {@link org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository#getSchemaSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier, Class)}
223 @Nullable String getSource();