X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=yang%2Fyang-parser-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fyangtools%2Fyang%2Fparser%2Fstmt%2Frfc6020%2Feffective%2FAbstractEffectiveModule.java;h=2367db331ad5315107737b31ee1afe794e896f98;hb=4968d735af48cd6b0ea91b37fbd238316c7cb46c;hp=f73b455b4d1d98431e42564f8f3e77327f0cd103;hpb=82af449e4ef07d80490e79484d0402b81009541e;p=yangtools.git diff --git a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveModule.java b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveModule.java index f73b455b4d..2367db331a 100644 --- a/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveModule.java +++ b/yang/yang-parser-impl/src/main/java/org/opendaylight/yangtools/yang/parser/stmt/rfc6020/effective/AbstractEffectiveModule.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Map; import java.util.Set; import org.opendaylight.yangtools.concepts.Immutable; +import org.opendaylight.yangtools.concepts.SemVer; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil; @@ -74,6 +75,7 @@ abstract class AbstractEffectiveModule> exte private final Set uses; private final Set> typeDefinitions; private final Set publicChildNodes; + private final SemVer semanticVersion; AbstractEffectiveModule(final StmtContext> ctx) { super(ctx); @@ -86,6 +88,9 @@ abstract class AbstractEffectiveModule> exte YangVersionEffectiveStatementImpl yangVersionStmt = firstEffective(YangVersionEffectiveStatementImpl.class); this.yangVersion = (yangVersionStmt == null) ? "1" : yangVersionStmt.argument(); + SemanticVersionEffectiveStatementImpl semanticVersionStmt = firstEffective(SemanticVersionEffectiveStatementImpl.class); + this.semanticVersion = (semanticVersionStmt == null) ? DEFAULT_SEMANTIC_VERSION : semanticVersionStmt.argument(); + OrganizationEffectiveStatementImpl organizationStmt = firstEffective(OrganizationEffectiveStatementImpl.class); this.organization = (organizationStmt == null) ? null : organizationStmt.argument(); @@ -215,7 +220,11 @@ abstract class AbstractEffectiveModule> exte this.unknownNodes = ImmutableList.copyOf(unknownNodesInit); this.augmentations = ImmutableSet.copyOf(augmentationsInit); - this.imports = ImmutableSet.copyOf(resolveModuleImports(importsInit, ctx)); + if (ctx.isEnabledSemanticVersioning()) { + this.imports = ImmutableSet.copyOf(importsInit); + } else { + this.imports = ImmutableSet.copyOf(resolveModuleImports(importsInit, ctx)); + } this.notifications = ImmutableSet.copyOf(notificationsInit); this.rpcs = ImmutableSet.copyOf(rpcsInit); this.deviations = ImmutableSet.copyOf(deviationsInit); @@ -381,6 +390,11 @@ abstract class AbstractEffectiveModule> exte return uses; } + @Override + public SemVer getSemanticVersion() { + return semanticVersion; + } + @Override public String toString() { return this.getClass().getSimpleName() + "[" +