Search in sources :

Example 6 with ModuleStatement

use of org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement in project mdsal by opendaylight.

the class YangSourceDefinition method of.

public static Optional<YangSourceDefinition> of(final Module module) {
    final ModuleEffectiveStatement effective = module.asEffectiveStatement();
    final ModuleStatement declared = effective.getDeclared();
    if (declared != null) {
        return Optional.of(new Single(effective, module));
    }
    return Optional.empty();
}
Also used : ModuleStatement(org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement) ModuleEffectiveStatement(org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement)

Aggregations

ModuleStatement (org.opendaylight.yangtools.yang.model.api.stmt.ModuleStatement)6 ModuleEffectiveStatement (org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement)4 Test (org.junit.Test)3 Revision (org.opendaylight.yangtools.yang.common.Revision)2 Module (org.opendaylight.yangtools.yang.model.api.Module)2 SchemaContext (org.opendaylight.yangtools.yang.model.api.SchemaContext)2 NamespaceStatement (org.opendaylight.yangtools.yang.model.api.stmt.NamespaceStatement)2 PrefixStatement (org.opendaylight.yangtools.yang.model.api.stmt.PrefixStatement)2 StatementStreamSource (org.opendaylight.yangtools.yang.parser.spi.source.StatementStreamSource)2 QNameModule (org.opendaylight.yangtools.yang.common.QNameModule)1 XMLNamespace (org.opendaylight.yangtools.yang.common.XMLNamespace)1 Submodule (org.opendaylight.yangtools.yang.model.api.Submodule)1 ArgumentStatement (org.opendaylight.yangtools.yang.model.api.stmt.ArgumentStatement)1 BelongsToStatement (org.opendaylight.yangtools.yang.model.api.stmt.BelongsToStatement)1 ExtensionStatement (org.opendaylight.yangtools.yang.model.api.stmt.ExtensionStatement)1 FeatureStatement (org.opendaylight.yangtools.yang.model.api.stmt.FeatureStatement)1 IdentityStatement (org.opendaylight.yangtools.yang.model.api.stmt.IdentityStatement)1 IfFeatureStatement (org.opendaylight.yangtools.yang.model.api.stmt.IfFeatureStatement)1 ImportStatement (org.opendaylight.yangtools.yang.model.api.stmt.ImportStatement)1 IncludeStatement (org.opendaylight.yangtools.yang.model.api.stmt.IncludeStatement)1