accessing a project's properties file in a lombok handler?

232 views
Skip to first unread message

Ray Vanderborght

unread,
Nov 7, 2009, 11:30:54 PM11/7/09
to project...@googlegroups.com
I added support for java.util.logging to morbok's @Logger recently (with slf4j coming next) and it occurred to me that I really want to allow externalizing the configuration into a properties file in the project's classpath.

So instead of doing this for every non-log4j @Logger enabled class:

@Logger(type=Logger.Type.JAVA)

you could just specify vanilla @Logger and let the properties file dictate which logger type gets generated.  Unfortunately I can't get the handler to find the properties file... perhaps because of some classloader isolation going on.  I took a few shot-in-the-dark attempts but no luck so far.  Am I dreaming that this could be doable?  The commented out section of my eclipse handler below shows the general idea:


Thanks,

Reinier Zwitserloot

unread,
Nov 8, 2009, 2:28:46 AM11/8/09
to project...@googlegroups.com
Well, in order to support compile-time type reflection, which you'd need for @Delegate, closures, and about half the features we cook up, you need access to the local concept of the filer - the thing that you can ask questions like:

This code mentions "List" - um, what's that referring to, and what methods does this 'List' thingie have?


In javac, we pretty much already have access. In eclipse, it's slightly more complicated as we hook at an earlier level, but we need to go here anyway. Once we code in access to the filer within lombok, then using it to find a properties file that is in the source and/or classpath should be a trivial exercise. Until then, though...

--Reinier Zwitserloot

Ray Vanderborght

unread,
Nov 8, 2009, 11:10:14 AM11/8/09
to project...@googlegroups.com
Good to know, thanks.
--
http://www.bartendr.com
Reply all
Reply to author
Forward
0 new messages