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;
14 import org.opendaylight.yangtools.concepts.SemVer;
17 * This interface contains the methods for getting the data from the YANG
20 * <i>Example of YANG module</i> <code><br>
21 * {@link #getName() <b><font color="#FF0000">module</font></b>} module_name{<br>
22 {@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br><br>
24 {@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br>
25 {@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br><br>
27 {@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br>
28 {@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br><br>
30 {@link #getOrganization() <b><font color="#606060">organization</font></b>} "John Doe, john.doe@email.com";<br>
31 {@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br><br>
33 {@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br>
34 description "description of some feature";<br>
37 {@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br>
38 {@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br>
39 <!-- {@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br> -->
40 {@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br>
41 {@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br>
44 {@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br>
46 {@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br>
47 prefix "other_module_prefix"<br>
48 revision-date 2011-08-27<br>
51 container cont {<br>
54 {@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br>
61 public interface Module extends DataNodeContainer, SourceStreamAware, ModuleIdentifier {
63 * Default semantic version of Module.
65 SemVer DEFAULT_SEMANTIC_VERSION = SemVer.create(0, 0, 0);
68 * Returns the prefix of the module
70 * @return string with the module prefix which is specified as argument of
71 * YANG {@link Module <b><font color="#0000FF">prefix</font></b>}
77 * Returns the YANG version.
81 * @return string with the module YANG version which is specified as
82 * argument of YANG {@link Module <b> <font
83 * color="#8b4513">yang-version</font></b>} keyword
85 String getYangVersion();
88 * Returns the module description.
90 * @return string with the module description which is specified as argument
91 * of YANG {@link Module <b><font
92 * color="#b8860b">description</font></b>} keyword
94 String getDescription();
97 * Returns the module reference.
99 * @return string with the module reference which is specified as argument
100 * of YANG {@link Module <b><font
101 * color="#008b8b">reference</font></b>} keyword
103 String getReference();
106 * Returns the module organization.
108 * @return string with the name of the organization specified in the module
109 * as the argument of YANG {@link Module <b><font
110 * color="#606060">organization</font></b>} keyword
112 String getOrganization();
115 * Returns the module contact.
117 * The contact represents the person or persons to whom technical queries
118 * concerning this module should be sent, such as their name, postal
119 * address, telephone number, and electronic mail address.
121 * @return string with the contact data specified in the module as the
122 * argument of YANG {@link Module <b><font
123 * color="#FF9900">contact</font></b>} keyword
128 * Returns imports which represents YANG modules which are imported to this
129 * module via <b>import</b> statement.
131 * @return set of module imports which are specified in the module as the
132 * argument of YANG {@link Module <b><font
133 * color="#9400d3">import</font></b>} keywords.
135 Set<ModuleImport> getImports();
137 Set<Module> getSubmodules();
140 * Returns <code>FeatureDefinition</code> instances which contain data from
141 * <b>feature</b> statements defined in the module.
143 * The feature is used to define a mechanism by which portions of the schema
144 * are marked as conditional.
146 * @return feature statements in lexicographical order which are specified
147 * in the module as the argument of YANG {@link Module <b><font
148 * color="#8b0000">feature</font></b>} keywords.
150 Set<FeatureDefinition> getFeatures();
153 * Returns <code>NotificationDefinition</code> instances which contain data
154 * from <b>notification</b> statements defined in the module.
156 * @return notification statements in lexicographical order which are
157 * specified in the module as the argument of YANG {@link Module
158 * <b><font color="#b22222">notification</font></b>} keywords.
160 Set<NotificationDefinition> getNotifications();
163 * Returns <code>AugmentationSchema</code> instances which contain data from
164 * <b>augment</b> statements defined in the module.
166 * @return set of the augmentation schema instances which are specified in
167 * the module as YANG {@link Module <b><font
168 * color="#dc143c">augment</font></b>} keyword and are
169 * lexicographically ordered
171 Set<AugmentationSchema> getAugmentations();
174 * Returns <code>RpcDefinition</code> instances which contain data from
175 * <b>rpc</b> statements defined in the module.
177 * @return set of the rpc definition instances which are specified in the
178 * module as YANG {@link Module <b><font
179 * color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
182 Set<RpcDefinition> getRpcs();
185 * Returns <code>Deviation</code> instances which contain data from
186 * <b>deviation</b> statements defined in the module.
188 * @return set of the deviation instances
190 Set<Deviation> getDeviations();
193 * Returns <code>IdentitySchemaNode</code> instances which contain data from
194 * <b>identity</b> statements defined in the module.
196 * @return set of identity schema node instances which are specified in the
197 * module as YANG {@link Module <b><font
198 * color="#bdb76b">identity</font></b>} keywords and are
199 * lexicographically ordered
201 Set<IdentitySchemaNode> getIdentities();
204 * Returns <code>ExtensionDefinition</code> instances which contain data
205 * from <b>extension</b> statements defined in the module.
207 * @return set of extension definition instances which are specified in the
208 * module as YANG {@link Module <b><font
209 * color="#808000">extension</font></b>} keyword and are
210 * lexicographically ordered
212 List<ExtensionDefinition> getExtensionSchemaNodes();
215 * Returns unknown nodes defined in module.
217 * @return unknown nodes in lexicographical order
219 List<UnknownSchemaNode> getUnknownSchemaNodes();
224 * @return YANG text of this module, or null if the source is not available.
225 * @deprecated Use {@link org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository#getSchemaSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier, Class)}
229 @Nullable String getSource();