Remove implementations of definitions from template 51/54851/2
authorJakub Toth <jatoth@cisco.com>
Wed, 12 Apr 2017 09:33:01 +0000 (11:33 +0200)
committerRobert Varga <nite@hq.sk>
Fri, 14 Apr 2017 14:47:44 +0000 (14:47 +0000)
Change-Id: I5c1fc43c0de58700ef73a080c3b8028cf5ccc91a
Signed-off-by: Jakub Toth <jatoth@cisco.com>
binding2/mdsal-binding2-generator-impl/src/main/twirl/org/opendaylight/mdsal/binding/javav2/generator/impl/yangTemplateForModule.scala.txt
binding2/mdsal-binding2-generator-impl/src/test/java/org/opendaylight/mdsal/binding/javav2/generator/impl/YangTemplateTest.java
binding2/mdsal-binding2-generator-impl/src/test/resources/yang-template/yang-template-test.yang

index 3f7bc1db7fccd8b95c76397733d0aa8d86137088..5ee18de975687b012a2299882c67d056c7e93c29 100644 (file)
@@ -16,9 +16,9 @@
 @import org.opendaylight.mdsal.binding.javav2.generator.impl.util.YangTextTemplate
 @import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil
 @import org.opendaylight.yangtools.yang.model.api.Module
+@import org.opendaylight.yangtools.yang.model.api.DocumentedNode
 @import org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement
-@import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.ModuleEffectiveStatementImpl
-@import org.opendaylight.yangtools.yang.parser.stmt.rfc6020.effective.RevisionEffectiveStatementImpl
+@import org.opendaylight.yangtools.yang.model.api.stmt.RevisionStatement
 
 @(module: Module)
 @if(module != null) {
@@ -40,9 +40,9 @@
         }
         @if(module.getRevision() != null) {
             revision @{SimpleDateFormatUtil.getRevisionFormat().format(module.getRevision())} {
-                @for(effectiveStatement <- module.asInstanceOf[ModuleEffectiveStatementImpl].effectiveSubstatements()){
-                    @if(effectiveStatement.isInstanceOf[RevisionEffectiveStatementImpl]){
-                        description "@{effectiveStatement.asInstanceOf[RevisionEffectiveStatementImpl].getDescription()}";
+                @for(effectiveStatement <- module.asInstanceOf[EffectiveStatement[_, _]].effectiveSubstatements()){
+                    @if(effectiveStatement.getDeclared().isInstanceOf[RevisionStatement]){
+                        description "@{effectiveStatement.asInstanceOf[DocumentedNode].getDescription()}";
                     }
                 }
             }
index 183d9917abb253124aa8f889229e29b1244a71fc..19ca3cd92865b42ec3e8f7c92a1017c513a5f921 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.mdsal.binding.javav2.generator.impl;
 
 import static org.junit.Assert.assertTrue;
+
 import com.google.common.annotations.Beta;
 import java.io.FileNotFoundException;
 import java.net.URISyntaxException;
index 928a01960b04bab79bd40feba7d01884a6b5ad57..dc26e328bedfc019161c81d17990f5cd015b27fe 100644 (file)
@@ -70,7 +70,7 @@ module yang-template-test {
 
     list simple-list-more-arg-in-unique {
         key "simple-list-leaf-1";
-        unique "simple-list-leaf-2 simple-list-leaf-1";
+        unique "simple-list-leaf-1 simple-list-leaf-2";
         leaf simple-list-leaf-1 {
             type string;
         }
@@ -92,13 +92,13 @@ module yang-template-test {
     }
 
     choice simple-choice {
-        case simple-case-2 {
-            leaf simple-case-2-leaf {
+        case simple-case-1 {
+            leaf simple-case-1-leaf {
                 type string;
             }
         }
-        case simple-case-1 {
-            leaf simple-case-1-leaf {
+        case simple-case-2 {
+            leaf simple-case-2-leaf {
                 type string;
             }
         }