You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Matt Sicker (Jira)" <ji...@apache.org> on 2019/10/06 18:11:00 UTC

[jira] [Created] (LOG4J2-2700) Add support for injecting plugin configuration via builder methods

Matt Sicker created LOG4J2-2700:
-----------------------------------

             Summary: Add support for injecting plugin configuration via builder methods
                 Key: LOG4J2-2700
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2700
             Project: Log4j 2
          Issue Type: Improvement
          Components: Plugins
            Reporter: Matt Sicker
            Assignee: Matt Sicker
             Fix For: 3.0.0


Prior to this feature, a plugin builder class could only have configuration values injected via fields. While all Log4j plugin builder classes typically include corresponding setFoo or withFoo methods to set values to all those fields, these methods were not used by the plugin system.

This feature is to expand the support of using @PluginAttribute, @PluginElement, @PluginValue, @PluginNode, @PluginConfiguration, @PluginAliases, and any validation annotations on single-argument methods in a builder class. The default name extracted for these methods should be the "foo" from setFoo or withFoo if named that way, or it should use the name of the method parameter otherwise.

As with parameters injected via a static factory method, these values should be validated by checking their types as well as validation constraints before being bound. Default values can be specified the same way as well. This allows for each setter or wither method to perform any addition programmatic validation if necessary, and it reduces coupling of implementation details to the public API of a plugin.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)