Added generation of case's child nodes description to documentation generator. 18/3718/1
authorMartin Vitez <mvitez@cisco.com>
Fri, 13 Dec 2013 18:28:22 +0000 (19:28 +0100)
committerMartin Vitez <mvitez@cisco.com>
Fri, 13 Dec 2013 18:28:22 +0000 (19:28 +0100)
Signed-off-by: Martin Vitez <mvitez@cisco.com>
code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend

index 3bfc2f3d59154715cbec0ee30482e79db130185c..e7323720b2ed48c2e8d1539b3071cf2387622b38 100644 (file)
@@ -208,6 +208,7 @@ class GeneratorImpl {
                 <li>\r
                     augment\r
                     «augment.augmentationInfo(InstanceIdentifier.builder().toInstance())»\r
+                    «augment.childNodes.printChildren(2,InstanceIdentifier.builder().toInstance())»\r
                 </li>\r
             «ENDFOR»\r
             </ul>\r
@@ -353,6 +354,7 @@ class GeneratorImpl {
     val leafNodes = nodes.filter(LeafSchemaNode)\r
     val leafListNodes = nodes.filter(LeafListSchemaNode)\r
     val choices = nodes.filter(ChoiceNode)\r
+    val cases = nodes.filter(ChoiceCaseNode)\r
     val containers = nodes.filter(ContainerSchemaNode)\r
     val lists = nodes.filter(ListSchemaNode)\r
     return '''\r
@@ -383,6 +385,12 @@ class GeneratorImpl {
         «FOR childNode : lists»\r
             «childNode.printInfo(level,path)»\r
         «ENDFOR»\r
+        «FOR childNode : choices»\r
+            «childNode.printInfo(level,path)»\r
+        «ENDFOR»\r
+        «FOR childNode : cases»\r
+            «childNode.printInfo(level,path)»\r
+        «ENDFOR»\r
         \r
     '''\r
     }\r
@@ -466,7 +474,16 @@ class GeneratorImpl {
         </dl>\r
         «node.childNodes.printChildren(level,newPath)»\r
     '''\r
-    \r
+\r
+    private def dispatch CharSequence printInfo(ChoiceNode node, int level, InstanceIdentifier path) '''\r
+        «val Set<DataSchemaNode> choiceCases = new HashSet(node.cases)»\r
+        «choiceCases.printChildren(level,path)»\r
+    '''\r
+\r
+    private def dispatch CharSequence printInfo(ChoiceCaseNode node, int level, InstanceIdentifier path) '''\r
+        «node.childNodes.printChildren(level,path)»\r
+    '''\r
+\r
     def CharSequence printShortInfo(ContainerSchemaNode node, int level, InstanceIdentifier path) {\r
         val newPath = path.append(node);\r
         return '''\r
@@ -492,7 +509,7 @@ class GeneratorImpl {
             <li>«strong((node.QName.localName))» (leaf-list)</li>\r
         '''\r
     }\r
-    \r
+\r
     def CharSequence localLink(InstanceIdentifier identifier, CharSequence text) '''\r
         <a href="#«FOR cmp : identifier.path SEPARATOR "/"»«cmp.nodeType.localName»«ENDFOR»">«text»</a>\r
     '''\r