From: Robert Varga Date: Sat, 2 Jan 2016 13:35:36 +0000 (+0100) Subject: BUG-865: deprecate Module#getSource() X-Git-Tag: release/beryllium~49 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=yangtools.git;a=commitdiff_plain;h=c74b9e919a4af1a31155edeb1d9f84f31518c938 BUG-865: deprecate Module#getSource() 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 --- diff --git a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java index 0da03eb986..8af290e522 100644 --- a/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java +++ b/yang/yang-model-api/src/main/java/org/opendaylight/yangtools/yang/model/api/Module.java @@ -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 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(); }