Class YangModelDependencyInfo
java.lang.Object
org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangModelDependencyInfo
- Direct Known Subclasses:
YangModelDependencyInfo.ModuleDependencyInfo
,YangModelDependencyInfo.SubmoduleDependencyInfo
Helper transfer object which holds basic and dependency information for YANG
model.
There are two concrete implementations of this interface:
YangModelDependencyInfo.ModuleDependencyInfo
- Dependency information for moduleYangModelDependencyInfo.SubmoduleDependencyInfo
- Dependency information for submodule
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Dependency information for YANG module.static final class
Dependency information for submodule, also provides name for parent module. -
Method Summary
Modifier and TypeMethodDescriptionboolean
static @NonNull YangModelDependencyInfo
forIR
(YangIRSchemaSource source) ExtractsYangModelDependencyInfo
from an intermediate representation root statement of a YANG model.static YangModelDependencyInfo
forYangText
(YangTextSchemaSource yangText) ExtractsYangModelDependencyInfo
from aYangTextSchemaSource
.Returns immutable collection of all module imports.Returns formatted revision string.static String
getLatestRevision
(IRStatement module, SourceIdentifier source) getName()
Returns model name.Returns revision.int
hashCode()
-
Method Details
-
getDependencies
Returns immutable collection of all module imports. This collection contains bothimport
statements andinclude
statements for submodules.- Returns:
- Immutable collection of imports.
-
getName
Returns model name.- Returns:
- model name
-
getFormattedRevision
Returns formatted revision string.- Returns:
- formatted revision string
-
getRevision
Returns revision.- Returns:
- revision, potentially null
-
hashCode
public int hashCode() -
equals
-
forIR
ExtractsYangModelDependencyInfo
from an intermediate representation root statement of a YANG model.- Parameters:
source
- Schema source- Returns:
YangModelDependencyInfo
- Throws:
IllegalArgumentException
- If the root statement is not a valid YANG module/submodule
-
forYangText
public static YangModelDependencyInfo forYangText(YangTextSchemaSource yangText) throws IOException, YangSyntaxErrorException ExtractsYangModelDependencyInfo
from aYangTextSchemaSource
. This parsing does not validate full YANG module, only parses header up to the revisions and imports.- Parameters:
yangText
-YangTextSchemaSource
- Returns:
YangModelDependencyInfo
- Throws:
YangSyntaxErrorException
- If the resource does not pass syntactic analysisIOException
- When the resource cannot be read
-
getLatestRevision
-