ppkarwasz commented on code in PR #88:
URL: 
https://github.com/apache/logging-log4j-tools/pull/88#discussion_r1426559104


##########
log4j-docgen/src/main/mdo/plugins.xml:
##########
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one or more
+  ~ contributor license agreements.  See the NOTICE file distributed with
+  ~ this work for additional information regarding copyright ownership.
+  ~ The ASF licenses this file to you under the Apache License, Version 2.0
+  ~ (the "License"); you may not use this file except in compliance with
+  ~ the License.  You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<model xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0";
+       xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 
https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd";
+       xml.namespace="https://logging.apache.org/log4j/plugins";>
+    <id>plugins</id>
+    <name>PluginBundle</name>
+    <description>Documents a bundle of Log4j plugins.</description>
+    <versionDefinition>
+        <type>field</type>
+        <value>schemaVersion</value>
+    </versionDefinition>
+    <defaults>
+        <default>
+            <key>package</key>
+            <value>org.apache.logging.log4j.docgen.model</value>
+        </default>
+    </defaults>
+
+    <classes>
+        <class rootElement="true">
+            <name>PluginBundle</name>
+            <description>Documents a bundle of Log4j plugins.</description>
+            <fields>
+                <field xml.attribute="true" xml.tagName="version">
+                    <name>schemaVersion</name>
+                    <type>String</type>
+                    <required>true</required>
+                    <description>The version of the schema used by the XML 
document.</description>
+                </field>
+                <field>
+                    <name>groupId</name>
+                    <type>String</type>
+                    <description>The group id of the bundle.</description>
+                </field>
+                <field>
+                    <name>artifactId</name>
+                    <type>String</type>
+                    <description>The artifact id of the bundle.</description>
+                </field>
+                <field>
+                    <name>version</name>
+                    <type>String</type>
+                    <description>The version of the bundle.</description>
+                </field>
+                <field>
+                    <name>description</name>
+                    <association>
+                        <type>Description</type>
+                    </association>
+                    <description>Description of the bundle.</description>
+                </field>
+                <field>
+                    <name>enums</name>
+                    <association>
+                        <type>EnumType</type>
+                        <multiplicity>*</multiplicity>
+                    </association>
+                    <description>A list of all enums used in 
properties.</description>
+                </field>
+                <field>
+                    <name>plugins</name>
+                    <association>
+                        <type>PluginEntry</type>
+                        <multiplicity>*</multiplicity>
+                    </association>
+                    <description>A list of all plugins in the 
bundle.</description>
+                </field>
+            </fields>
+        </class>
+
+        <class xml.tagName="plugin">
+            <name>PluginEntry</name>
+            <description>Describes the properties available to 
plugins.</description>
+            <fields>
+                <field xml.attribute="true">
+                    <name>name</name>
+                    <type>String</type>
+                    <required>true</required>
+                    <description>The unique name of this plugin.</description>
+                </field>
+                <field xml.attribute="true">
+                    <name>namespace</name>
+                    <type>String</type>
+                    <required>true</required>
+                    <description>The namespace of the plugin.</description>
+                </field>
+                <field xml.attribute="true">
+                    <name>className</name>
+                    <type>String</type>
+                    <required>true</required>
+                    <description>Fully qualified name of the class 
implementing the plugin.</description>
+                </field>
+                <field xml.attribute="true">
+                    <name>deferChildren</name>
+                    <type>boolean</type>
+                    <defaultValue>false</defaultValue>
+                </field>
+                <field>
+                    <name>description</name>
+                    <association>
+                        <type>Description</type>
+                    </association>
+                    <description>Description of the plugin.</description>
+                </field>
+                <field>
+                    <name>keys</name>
+                    <required>true</required>
+                    <association>
+                        <type>String</type>
+                        <multiplicity>*</multiplicity>
+                    </association>
+                    <description>
+                        The different keys (e.g. XML tag names) under which 
the plugin can be used.
+                    </description>
+                </field>
+                <!-- These are necessary to find all possible nested 
components -->
+                <field>
+                    <name>supertypes</name>
+                    <association>
+                        <type>String</type>
+                        <multiplicity>*</multiplicity>
+                    </association>
+                    <description>
+                        List of all the supertypes of a plugin.
+                    </description>
+                </field>
+                <field>
+                    <name>attributes</name>
+                    <required>true</required>
+                    <association>
+                        <type>PluginAttribute</type>
+                        <multiplicity>*</multiplicity>
+                    </association>
+                    <description>List of **all** the configuration attributes 
supported</description>
+                </field>
+                <field>
+                    <name>elements</name>
+                    <required>true</required>
+                    <association>
+                        <type>PluginElement</type>
+                        <multiplicity>*</multiplicity>
+                    </association>
+                    <description>List of **all** possible nested 
components.</description>
+                </field>

Review Comment:
   Good point,
   
   From a JSON and YAML perspective the distinction is not as evident 
("elements" are properties with an object value), but I would keep the 
distinction for the user: "attributes" are injected by **name**, whereas 
"elements" are injected by **type**. Knowing that simplifies configuration 
considerably.
   
   I will look at this again to see if I can simplify things.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to