From: Martin Vitez Date: Fri, 13 Dec 2013 18:28:22 +0000 (+0100) Subject: Added generation of case's child nodes description to documentation generator. X-Git-Tag: yangtools-0.6.0~123^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=4d3dea863a48e1f8551c8e9c15d63240beda7af9;p=yangtools.git Added generation of case's child nodes description to documentation generator. Signed-off-by: Martin Vitez --- diff --git a/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend b/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend index 3bfc2f3d59..e7323720b2 100644 --- a/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend +++ b/code-generator/maven-sal-api-gen-plugin/src/main/java/org/opendaylight/yangtools/yang/unified/doc/generator/GeneratorImpl.xtend @@ -208,6 +208,7 @@ class GeneratorImpl {
  • augment «augment.augmentationInfo(InstanceIdentifier.builder().toInstance())» + «augment.childNodes.printChildren(2,InstanceIdentifier.builder().toInstance())»
  • «ENDFOR» @@ -353,6 +354,7 @@ class GeneratorImpl { val leafNodes = nodes.filter(LeafSchemaNode) val leafListNodes = nodes.filter(LeafListSchemaNode) val choices = nodes.filter(ChoiceNode) + val cases = nodes.filter(ChoiceCaseNode) val containers = nodes.filter(ContainerSchemaNode) val lists = nodes.filter(ListSchemaNode) return ''' @@ -383,6 +385,12 @@ class GeneratorImpl { «FOR childNode : lists» «childNode.printInfo(level,path)» «ENDFOR» + «FOR childNode : choices» + «childNode.printInfo(level,path)» + «ENDFOR» + «FOR childNode : cases» + «childNode.printInfo(level,path)» + «ENDFOR» ''' } @@ -466,7 +474,16 @@ class GeneratorImpl { «node.childNodes.printChildren(level,newPath)» ''' - + + private def dispatch CharSequence printInfo(ChoiceNode node, int level, InstanceIdentifier path) ''' + «val Set choiceCases = new HashSet(node.cases)» + «choiceCases.printChildren(level,path)» + ''' + + private def dispatch CharSequence printInfo(ChoiceCaseNode node, int level, InstanceIdentifier path) ''' + «node.childNodes.printChildren(level,path)» + ''' + def CharSequence printShortInfo(ContainerSchemaNode node, int level, InstanceIdentifier path) { val newPath = path.append(node); return ''' @@ -492,7 +509,7 @@ class GeneratorImpl {
  • «strong((node.QName.localName))» (leaf-list)
  • ''' } - + def CharSequence localLink(InstanceIdentifier identifier, CharSequence text) ''' «text» '''