BUG-865: deprecate Module#getSource() 03/32003/2
authorRobert Varga <robert.varga@pantheon.sk>
Sat, 2 Jan 2016 13:35:36 +0000 (14:35 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 4 Jan 2016 16:22:08 +0000 (16:22 +0000)
This method requires implementation to provide YANG text, which is not
always available. SchemaRepository provides the right abstractions for
acquiring the source in the required representation.

Change-Id: Ib769948e3fefc4f1a086f3620a7326fb076f7f95
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java

index 0da03eb986d914797343a4b973fe7b49af3bb2f3..8af290e522eb88486143e071b44da7c9f794f701 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.yangtools.yang.model.api;
 
 import java.util.List;
 import java.util.Set;
+import javax.annotation.Nullable;
 import javax.annotation.concurrent.Immutable;
 
 /**
@@ -212,8 +213,12 @@ public interface Module extends DataNodeContainer, SourceStreamAware, ModuleIden
     List<UnknownSchemaNode> getUnknownSchemaNodes();
 
     /**
-     * Get yang source.
+     * Get YANG source.
+     *
+     * @return YANG text of this module, or null if the source is not available.
+     * @deprecated Use {@link org.opendaylight.yangtools.yang.model.repo.api.SchemaRepository#getSchemaSource(org.opendaylight.yangtools.yang.model.repo.api.SourceIdentifier, Class)}
+     *             instead.
      */
-    String getSource();
-
+    @Deprecated
+    @Nullable String getSource();
 }