Sorry for a double post but… I was re-reading my above message and when looking at the template output again I think it looks a bit sloppy, surely I can do better than that? Especially now that I got a good taste of the Doc Composor. I definitely intend to keep this template, and who knows if it might become useful for me in the future.
So, uhm… “I did something”
I hope you can agree that this looks much better than that mess in my previous post? As you can see I even discovered a way how you can use properties (such as the annotation name) in a header, how cool is that?
Anyway, figured I’d share this edit as well. Also because you intentionally started with the idea to use a table yourself so I figured that this might also be useful for you.
<?xml version="1.0" encoding="UTF-8"?>
<ElementBaseInitiationBlock>
<Text style="@heading+">Overview of Java annotations</Text>
<ParagraphBreak/>
<HasValueChecker property="javaDetail" modelType="JavaClassCodeDetail" flag="false">
<Text>No annotations used in class </Text>
<Property property="name"/>
<Text>.</Text>
<ParagraphBreak/>
</HasValueChecker>
<HasValueChecker property="javaDetail" modelType="JavaClassCodeDetail" flag="true">
<Text style="@heading+">Class </Text>
<Property style="@heading" property="name"/>
<ParagraphBreak/>
<ParagraphBreak/>
<ModelElementProperty property="javaDetail">
<HasValueChecker property="annotations" modelType="JavaAnnotation">
<TableBlock tableStyle="Summaries" tableWidth="60%">
<TableRow>
<TableCell>
<Text>Annotation</Text>
</TableCell>
<TableCell>
<Text>Contains definitions?</Text>
</TableCell>
</TableRow>
<ForEach property="annotations">
<TableRow>
<TableCell>
<Text>@</Text>
<Property property="name"/>
</TableCell>
<TableCell>
<HasValueChecker property="properties" flag="true">
<Text>Yes</Text>
</HasValueChecker>
<HasValueChecker property="properties" flag="false">
<Text>No</Text>
</HasValueChecker>
</TableCell>
</TableRow>
</ForEach>
</TableBlock>
<ParagraphBreak/>
<Text style="@heading">List of annotation definitions (optional)</Text>
<ParagraphBreak/>
<ForEach property="annotations">
<Text style="@heading+">@</Text>
<Property style="@heading" property="name"/>
<HasValueChecker property="properties" flag="false">
<ParagraphBreak/>
</HasValueChecker>
<HasValueChecker property="properties" flag="true">
<ParagraphBreak/>
<TableBlock tableStyle="Summaries" tableWidth="80%">
<TableRow>
<TableCell>
<Text>Name</Text>
</TableCell>
<TableCell>
<Text>Value</Text>
</TableCell>
</TableRow>
<ForEach property="properties">
<TableRow>
<TableCell>
<Property property="name"/>
</TableCell>
<TableCell>
<Property property="value"/>
</TableCell>
</TableRow>
</ForEach>
</TableBlock>
</HasValueChecker>
</ForEach>
</HasValueChecker>
</ModelElementProperty>
</HasValueChecker>
</ElementBaseInitiationBlock>