logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: Registering converters
Date Tue, 03 Jun 2014 02:14:14 GMT
On Mon, Jun 2, 2014 at 10:08 PM, Matt Sicker <boards@gmail.com> wrote:

> On 2 June 2014 20:59, Gary Gregory <garydgregory@gmail.com> wrote:
>
>> If your builder has a triplet of ivar/getter/setter for each factory
>> parameter, then it's more code and more "complicated" than a single factory
>> method with paramters. IMO. YMMV. The problem here is that I do want to be
>> forced into one configuration style but OTOH I do not think it is good for
>> us to provide two or three styles to do the same thing. We need to pick
>> one. It' bad enough we have three different configuration file syntax
>> formats.
>>
>
> The builders have setters only (which return this at the end of each one).
> The fields themselves are used for getting the values. Really, the builders
> are basically auto-generated setters for the most part. I think Groovy has
> an easier way to do this via closures, but that's not really useful for us.
>
> To to follow the rest of Log4j, I could have a class with a bunch static
>> inner classes all annotated with something like @TypeConverter and that
>> would be it?
>>
>
> So scan for a new annotation? Or just re-use @Plugin on the class with a
> category like "TypeConverters" or similar?
>

Well, my point is that you'd just use an annotation. What the annotation
is, I do not know. I'm not crazy about the category idea in general because
I am one typo away on a late night from getting stuck. If the code does not
compile, that's easier to fix.

Gary


>
> --
> Matt Sicker <boards@gmail.com>
>



-- 
E-Mail: garydgregory@gmail.com | ggregory@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Mime
View raw message