Merge "Bug 1512 - generated builder java file for a leaf containing a union"
[mdsal.git] / code-generator / maven-sal-api-gen-plugin / src / main / java / org / opendaylight / yangtools / yang / unified / doc / generator / GeneratorImpl.xtend
index d8c49592965f0cb1f62654aed4bff87894c0269e..185299d190f35dca2e35424b3e40e577e195e526 100644 (file)
@@ -400,7 +400,7 @@ class GeneratorImpl {
         '''
     }
     
-    private def printAugmentedNode(DataSchemaNode child) {
+    private def CharSequence printAugmentedNode(DataSchemaNode child) {
         
         if(child instanceof ChoiceCaseNode)
             return ''
@@ -810,7 +810,8 @@ class GeneratorImpl {
                 «ENDFOR»
                 </ul>
                 <ul>
-                «FOR typeDef : dataNode.typeDefinitions»
+                «val Set<TypeDefinition<?>> typeDefinitions = dataNode.typeDefinitions»
+                «FOR typeDef : typeDefinitions»
                     «typeDef.restrictions»
                 «ENDFOR»
                 </ul>
@@ -975,9 +976,9 @@ class GeneratorImpl {
             </ul>
             «ENDIF»
 
-            «IF !path.path.empty»
+            «IF path.pathArguments.iterator.hasNext»
             <h3>XML example</h3>
-            «nodes.xmlExample(path.path.last.nodeType,path)»
+            «nodes.xmlExample(path.pathArguments.last.nodeType,path)»
             </h3>
             «ENDIF»
             «FOR childNode : containers»
@@ -1045,8 +1046,8 @@ class GeneratorImpl {
 
 
     def header(int level,YangInstanceIdentifier name) '''
-        <h«level» id="«FOR cmp : name.path SEPARATOR "/"»«cmp.nodeType.localName»«ENDFOR»">
-            «FOR cmp : name.path SEPARATOR "/"»«cmp.nodeType.localName»«ENDFOR»
+        <h«level» id="«FOR cmp : name.pathArguments SEPARATOR "/"»«cmp.nodeType.localName»«ENDFOR»">
+            «FOR cmp : name.pathArguments SEPARATOR "/"»«cmp.nodeType.localName»«ENDFOR»
         </h«level»>
     '''
 
@@ -1152,7 +1153,7 @@ class GeneratorImpl {
     }
 
     def CharSequence localLink(YangInstanceIdentifier identifier, CharSequence text) '''
-        <a href="#«FOR cmp : identifier.path SEPARATOR "/"»«cmp.nodeType.localName»«ENDFOR»">«text»</a>
+        <a href="#«FOR cmp : identifier.pathArguments SEPARATOR "/"»«cmp.nodeType.localName»«ENDFOR»">«text»</a>
     '''
 
 
@@ -1181,7 +1182,7 @@ class GeneratorImpl {
         append(currentModule.name)
         append(":")
         var previous = false;
-        for(arg : identifier.path) {
+        for(arg : identifier.pathArguments) {
             if(previous) append("/")
             append(arg.nodeType.localName);
             previous = true;