@@ -27,7 +27,7 @@ Class:: `${type.className}`
27
27
<#if sourcedType.groupId?has_content && sourcedType.artifactId?has_content >
28
28
Provider:: `${sourcedType.groupId} :${sourcedType.artifactId} `
29
29
30
- </#if >${(type.description.text)!'N/A' }
30
+ </#if >${(type.description.text)! }
31
31
32
32
[#${type.className?replace('.', '_') } -XML-snippet]
33
33
== XML snippet
@@ -48,16 +48,16 @@ ${indent}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(has_elements?th
48
48
</#list >
49
49
<#if has_elements >
50
50
<#list type.elements as element >
51
+ <#assign multiplicitySuffix = (element.multiplicity == '*')?then('<!-- multiple occurrences allowed -- >','')/>
52
+ <#assign elementName = 'a-' + element.type?keep_after_last('.') + '-implementation'/ >
51
53
<#if lookup[element.type ]??>
52
54
<#assign element_type = lookup[element.type ].type/>
53
55
<#-- @ftlvariable name="element_type" type="org.apache.logging.log4j.docgen.model.AbstractType" -->
54
56
<#if element_type.name?? && !element_type.implementations?has_content >
55
- <#-- @ftlvariable name="element_type" type="org.apache.logging.log4j.docgen.model.PluginType" -->
56
- <${element_type.name} />
57
- <#else >
58
- <a- ${element.type?keep_after_last( ' .' )}-implementation /><#if element.multiplicity == '*' ><!-- multiple occurrences allowed --> </#if >
57
+ <#assign elementName = element_type.name/ >
59
58
</#if >
60
59
</#if >
60
+ <${elementName} />${multiplicitySuffix}
61
61
</#list >
62
62
</${type.name} >
63
63
</#if >
@@ -68,17 +68,18 @@ ${indent}${attr.name}="${attr.defaultValue!}"${attr?is_last?then(has_elements?th
68
68
[#${type.className?replace('.', '_') } -attributes]
69
69
== Attributes
70
70
71
- Required attributes are in **bold face** .
71
+ Optional attributes are denoted by `?`-suffixed types .
72
72
73
73
[cols="1m,1m,1m,5"]
74
74
|===
75
75
|Name|Type|Default|Description
76
76
77
77
<#list type.attributes?sort_by('name') as attr >
78
- |${attr.required?then('**', '') }${attr.name}${attr.required?then('**', '') }
79
- |xref:../../scalars.adoc#${attr.type?replace('.', '_') } [${attr.type?contains('.')?then(attr.type?keep_after_last('.'), attr.type) } ]
78
+ <#assign requirementSuffix = attr.required?then('', '?')/ >
79
+ |${attr.name}
80
+ |xref:../../scalars.adoc#${attr.type?replace('.', '_') } [${attr.type?contains('.')?then(attr.type?keep_after_last('.'), attr.type) } ]${requirementSuffix}
80
81
|${attr.defaultValue! }
81
- a|${(attr.description.text)!'N/A' }
82
+ a|${(attr.description.text)! }
82
83
83
84
</#list >
84
85
|===
@@ -88,19 +89,41 @@ a|${(attr.description.text)!'N/A'}
88
89
[#${type.className?replace('.', '_') } -components]
89
90
== Nested components
90
91
91
- Required components are in **bold face** .
92
+ Optional components are denoted by `?`-suffixed types .
92
93
93
94
[cols="1m,1m,5"]
94
95
|===
95
96
|Tag|Type|Description
96
97
97
98
<#list type.elements?sort_by('type') as element >
99
+ <#assign requirementSuffix = element.required?then('', '?')/ >
100
+ <#assign descriptionCell = (element.description.text)!/ >
101
+ <#assign elementName = element.type?contains('.')?then(element.type?keep_after_last('.'), element.type)/ >
98
102
<#if lookup[element.type ]??>
99
- |${element.required?then('**', '') + (lookup[element.type].type.name!'N/A') + element.required?then('**', '') }
100
- |xref:${element.type} .adoc[${element.type?contains('.')?then(element.type?keep_after_last('.'), element.type) } ]
101
- a|${(element.description.text)!'N/A' }
102
-
103
+ <#assign elementSourcedType = lookup[element.type ]/>
104
+ <#assign elementType = elementSourcedType.type/ >
105
+ <#assign tagCell = elementType.name!/ >
106
+ <#switch elementType.class.simpleName >
107
+ <#case 'PluginType' >
108
+ <#case 'AbstractType' >
109
+ |${tagCell}
110
+ |xref:../../${elementSourcedType.groupId} /${elementSourcedType.artifactId} /${element.type} .adoc[${elementName} ]${requirementSuffix}
111
+ a|${descriptionCell}
112
+ <#break >
113
+ <#case 'ScalarType' >
114
+ |${tagCell}
115
+ |xref:../scalars.adoc#${element.type?replace('.', '_') } [${elementName} ]${requirementSuffix}
116
+ a|${descriptionCell}
117
+ <#break >
118
+ <#default >
119
+ <#stop 'Unknown type `' + element.type + '` modelled in class `' + elementType.class.name + '`'/ >
120
+ </#switch >
121
+ <#else >
122
+ |
123
+ |${elementName}${requirementSuffix}
124
+ a|${descriptionCell}
103
125
</#if >
126
+
104
127
</#list >
105
128
|===
106
129
</#if >
@@ -110,6 +133,7 @@ a|${(element.description.text)!'N/A'}
110
133
== Known implementations
111
134
112
135
<#list type.implementations as impl >
113
- * xref:${impl} .adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl) } ]
136
+ <#assign implSourcedType = lookup[impl ]/>
137
+ * xref:../../${implSourcedType.groupId} /${implSourcedType.artifactId} /${impl} .adoc[${impl?contains('.')?then(impl?keep_after_last('.'), impl) } ]
114
138
</#list >
115
139
</#if >
0 commit comments