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.Nonnull;
13 import javax.annotation.Nullable;
14 import javax.annotation.concurrent.Immutable;
15 import org.opendaylight.yangtools.concepts.SemVer;
18 * This interface contains the methods for getting the data from the YANG
21 * <i>Example of YANG module</i> <code><br>
22 * {@link #getName() <b><font color="#FF0000">module</font></b>} module_name{<br>
23 {@link #getYangVersion() <b><font color="#8b4513">yang-version</font></b>} "1";<br><br>
25 {@link #getNamespace() <b><font color="#00FF00">namespace</font></b>} "urn:module:namespace";<br>
26 {@link #getPrefix() <b><font color="#0000FF">prefix</font></b><a name="prefix"></a>} "prefix";<br><br>
28 {@link #getDescription() <b><font color="#b8860b">description</font></b>} "description test";<br>
29 {@link #getReference() <b><font color="#008b8b">reference</font></b>} "reference test";<br><br>
31 {@link #getOrganization() <b><font color="#606060">organization</font></b>} "John Doe, john.doe@email.com";<br>
32 {@link #getContact() <b><font color="#FF9900">contact</font></b>} "http://www.opendaylight.org/";<br><br>
34 {@link #getFeatures() <b><font color="#8b0000">feature</font></b>} feature-test{<br>
35 description "description of some feature";<br>
38 {@link #getNotifications() <b><font color="#b22222">notification</font></b>} notification-test;<br>
39 {@link #getRpcs() <b><font color="#d2691e">rpc</font></b>} rpc-test;<br>
40 <!-- {@link #getDeviations() <b><font color="#b8860b">deviation</font></b>} deviation-test;<br> -->
41 {@link #getIdentities() <b><font color="#bdb76b">identity</font></b>} identity-test;<br>
42 {@link #getExtensionSchemaNodes() <b><font color="#808000">extension</font></b>} extension-test;<br>
45 {@link #getRevision() <b><font color="#339900">revision</font></b>} 2011-08-27 {<br>
47 {@link #getImports() <b><font color="#9400d3">import</font></b>} other_module {<br>
48 prefix "other_module_prefix"<br>
49 revision-date 2011-08-27<br>
52 container cont {<br>
55 {@link #getAugmentations() <b><font color="#dc143c">augment</font></b>} "/cont" { ;<br>
62 public interface Module extends DataNodeContainer, SourceStreamAware, ModuleIdentifier, NotificationNodeContainer {
64 * Default semantic version of Module.
66 SemVer DEFAULT_SEMANTIC_VERSION = SemVer.create(0, 0, 0);
69 * Returns the prefix of the module
71 * @return string with the module prefix which is specified as argument of
72 * YANG {@link Module <b><font color="#0000FF">prefix</font></b>}
78 * Returns the YANG version.
82 * @return string with the module YANG version which is specified as
83 * argument of YANG {@link Module <b> <font
84 * color="#8b4513">yang-version</font></b>} keyword
86 String getYangVersion();
89 * Returns the module description.
91 * @return string with the module description which is specified as argument
92 * of YANG {@link Module <b><font
93 * color="#b8860b">description</font></b>} keyword
95 String getDescription();
98 * Returns the module reference.
100 * @return string with the module reference which is specified as argument
101 * of YANG {@link Module <b><font
102 * color="#008b8b">reference</font></b>} keyword
104 String getReference();
107 * Returns the module organization.
109 * @return string with the name of the organization specified in the module
110 * as the argument of YANG {@link Module <b><font
111 * color="#606060">organization</font></b>} keyword
113 String getOrganization();
116 * Returns the module contact.
118 * The contact represents the person or persons to whom technical queries
119 * concerning this module should be sent, such as their name, postal
120 * address, telephone number, and electronic mail address.
122 * @return string with the contact data specified in the module as the
123 * argument of YANG {@link Module <b><font
124 * color="#FF9900">contact</font></b>} keyword
129 * Returns imports which represents YANG modules which are imported to this
130 * module via <b>import</b> statement.
132 * @return set of module imports which are specified in the module as the
133 * argument of YANG {@link Module <b><font
134 * color="#9400d3">import</font></b>} keywords.
136 Set<ModuleImport> getImports();
138 Set<Module> getSubmodules();
141 * Returns <code>FeatureDefinition</code> instances which contain data from
142 * <b>feature</b> statements defined in the module.
144 * The feature is used to define a mechanism by which portions of the schema
145 * are marked as conditional.
147 * @return feature statements in lexicographical order which are specified
148 * in the module as the argument of YANG {@link Module <b><font
149 * color="#8b0000">feature</font></b>} keywords.
151 Set<FeatureDefinition> getFeatures();
154 * Returns <code>AugmentationSchema</code> instances which contain data from
155 * <b>augment</b> statements defined in the module.
157 * @return set of the augmentation schema instances which are specified in
158 * the module as YANG {@link Module <b><font
159 * color="#dc143c">augment</font></b>} keyword and are
160 * lexicographically ordered
162 Set<AugmentationSchema> getAugmentations();
165 * Returns <code>RpcDefinition</code> instances which contain data from
166 * <b>rpc</b> statements defined in the module.
168 * @return set of the rpc definition instances which are specified in the
169 * module as YANG {@link Module <b><font
170 * color="#d2691e">rpc</font></b>} keywords and are lexicographicaly
173 Set<RpcDefinition> getRpcs();
176 * Returns <code>Deviation</code> instances which contain data from
177 * <b>deviation</b> statements defined in the module.
179 * @return set of the deviation instances
181 Set<Deviation> getDeviations();
184 * Returns <code>IdentitySchemaNode</code> instances which contain data from
185 * <b>identity</b> statements defined in the module.
187 * @return set of identity schema node instances which are specified in the
188 * module as YANG {@link Module <b><font
189 * color="#bdb76b">identity</font></b>} keywords and are
190 * lexicographically ordered
192 Set<IdentitySchemaNode> getIdentities();
195 * Returns <code>ExtensionDefinition</code> instances which contain data
196 * from <b>extension</b> statements defined in the module.
198 * @return set of extension definition instances which are specified in the
199 * module as YANG {@link Module <b><font
200 * color="#808000">extension</font></b>} keyword and are
201 * lexicographically ordered
203 List<ExtensionDefinition> getExtensionSchemaNodes();
206 * Returns unknown nodes defined in module.
208 * @return unknown nodes in lexicographical order
211 List<UnknownSchemaNode> getUnknownSchemaNodes();
216 * @return YANG text of this module, or null if the source is not available.
217 * @deprecated Use {@link org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository#getSchemaSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier, Class)}
221 @Nullable String getSource();