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;
11 import java.util.List;
12 import java.util.Optional;
14 import javax.annotation.Nonnull;
15 import javax.annotation.concurrent.Immutable;
16 import org.opendaylight.yangtools.concepts.SemVer;
17 import org.opendaylight.yangtools.yang.common.QNameModule;
18 import org.opendaylight.yangtools.yang.common.Revision;
19 import org.opendaylight.yangtools.yang.common.YangVersion;
22 * This interface contains the methods for getting the data from the YANG
25 * <i>Example of YANG module</i> <code><br>
26 * {@link #getName() <b><font color="#FF0000">module</font></b>} module_name{<br>
27 {@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br><br>
29 {@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br>
30 {@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br><br>
32 {@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br>
33 {@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br><br>
35 {@link #getOrganization() <b><font color="#606060">organization</font></b>}
36 "John Doe, john.doe@email.com";<br>
37 {@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br>
40 {@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br>
41 description "description of some feature";<br>
44 {@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br>
45 {@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br>
46 <!-- {@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br> -->
47 {@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br>
48 {@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br>
51 {@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br>
53 {@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br>
54 prefix "other_module_prefix"<br>
55 revision-date 2011-08-27<br>
58 container cont {<br>
61 {@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br>
68 public interface Module extends DataNodeContainer, NotificationNodeContainer {
70 * Returns the name of the module which is specified as argument of YANG
71 * {@link Module <b><font color="#FF0000">module</font></b>} keyword.
73 * @return string with the name of the module
78 * Returns a {@link QNameModule}, which contains the namespace and
79 * the revision of the module.
81 * @return QNameModule identifier.
83 QNameModule getQNameModule();
86 * Returns the namespace of the module which is specified as argument of
87 * YANG {@link Module <b><font color="#00FF00">namespace</font></b>}
88 * keyword. If you need both namespace and revision, please consider using
89 * {@link #getQNameModule()}.
91 * @return URI format of the namespace of the module
93 default URI getNamespace() {
94 return getQNameModule().getNamespace();
98 * Returns the revision date for the module. If you need both namespace and
99 * revision, please consider using {@link #getQNameModule()}.
101 * @return date of the module revision which is specified as argument of
102 * YANG {@link Module <b><font color="#339900">revison</font></b>}
105 default Optional<Revision> getRevision() {
106 return getQNameModule().getRevision();
110 * Returns the semantic version of yang module.
113 * If the semantic version is not specified, default semantic version of
114 * module is returned.
116 * @return SemVer semantic version of yang module which is specified as
118 * (urn:opendaylight:yang:extension:semantic-version?revision
119 * =2016-02-02)semantic-version statement
121 Optional<SemVer> getSemanticVersion();
124 * Returns the prefix of the module.
126 * @return string with the module prefix which is specified as argument of
127 * YANG {@link Module <b><font color="#0000FF">prefix</font></b>}
133 * Returns the YANG version.
135 * @return YANG version of this module.
137 YangVersion getYangVersion();
140 * Returns the module description.
142 * @return string with the module description which is specified as argument
143 * of YANG {@link Module <b><font
144 * color="#b8860b">description</font></b>} keyword
146 String getDescription();
149 * Returns the module reference.
151 * @return string with the module reference which is specified as argument
152 * of YANG {@link Module <b><font
153 * color="#008b8b">reference</font></b>} keyword
155 String getReference();
158 * Returns the module organization.
160 * @return string with the name of the organization specified in the module
161 * as the argument of YANG {@link Module <b><font
162 * color="#606060">organization</font></b>} keyword
164 String getOrganization();
167 * Returns the module contact.
170 * The contact represents the person or persons to whom technical queries
171 * concerning this module should be sent, such as their name, postal
172 * address, telephone number, and electronic mail address.
174 * @return string with the contact data specified in the module as the
175 * argument of YANG {@link Module <b><font
176 * color="#FF9900">contact</font></b>} keyword
181 * Returns imports which represents YANG modules which are imported to this
182 * module via <b>import</b> statement.
184 * @return set of module imports which are specified in the module as the
185 * argument of YANG {@link Module <b><font
186 * color="#9400d3">import</font></b>} keywords.
188 Set<ModuleImport> getImports();
190 Set<Module> getSubmodules();
193 * Returns <code>FeatureDefinition</code> instances which contain data from
194 * <b>feature</b> statements defined in the module.
197 * The feature is used to define a mechanism by which portions of the schema
198 * are marked as conditional.
200 * @return feature statements in lexicographical order which are specified
201 * in the module as the argument of YANG {@link Module <b><font
202 * color="#8b0000">feature</font></b>} keywords.
204 Set<FeatureDefinition> getFeatures();
207 * Returns <code>AugmentationSchema</code> instances which contain data from
208 * <b>augment</b> statements defined in the module.
210 * @return set of the augmentation schema instances which are specified in
211 * the module as YANG {@link Module <b><font
212 * color="#dc143c">augment</font></b>} keyword and are
213 * lexicographically ordered
215 Set<AugmentationSchema> getAugmentations();
218 * Returns <code>RpcDefinition</code> instances which contain data from
219 * <b>rpc</b> statements defined in the module.
221 * @return set of the rpc definition instances which are specified in the
222 * module as YANG {@link Module <b><font
223 * color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
226 Set<RpcDefinition> getRpcs();
229 * Returns <code>Deviation</code> instances which contain data from
230 * <b>deviation</b> statements defined in the module.
232 * @return set of the deviation instances
234 Set<Deviation> getDeviations();
237 * Returns <code>IdentitySchemaNode</code> instances which contain data from
238 * <b>identity</b> statements defined in the module.
240 * @return set of identity schema node instances which are specified in the
241 * module as YANG {@link Module <b><font
242 * color="#bdb76b">identity</font></b>} keywords and are
243 * lexicographically ordered
245 Set<IdentitySchemaNode> getIdentities();
248 * Returns <code>ExtensionDefinition</code> instances which contain data
249 * from <b>extension</b> statements defined in the module.
251 * @return set of extension definition instances which are specified in the
252 * module as YANG {@link Module <b><font
253 * color="#808000">extension</font></b>} keyword and are
254 * lexicographically ordered
256 List<ExtensionDefinition> getExtensionSchemaNodes();
259 * Returns unknown nodes defined in module.
261 * @return unknown nodes in lexicographical order
264 List<UnknownSchemaNode> getUnknownSchemaNodes();