users@jaxb.java.net

Re: Classpath scanning for classes

From: Kohsuke Kawaguchi <kk_at_kohsuke.org>
Date: Wed, 11 Jun 2008 08:50:38 -0700

Thank you.

I'd imagine a little glue code that uses this to figure out classes with
a JAXB annotation and then return it as Class[] would be a nice JAXB
commons project.

 From there, people can easily create JAXBContext.

Would you be interested in writing on, Dimitris? :-)

Dimitris Andreou wrote:
> Hi Koshuke,
> I'm at SpringOne conference @ Belgium. I see that spring (2.5) has a new
> utility that scans classes out of the classpath (searching for some
> annotated classes).
> Although I was not able to find the code (yet), it sounds like that
> could be modified/used to alleviate the need for XmlSeeAlso. Well, there
> are caveats for you
> (or, your replacement anyway! :)) to consider though. It supports either
> directories or jar files, and parses .class files with ASM to avoid
> actually loading them.
> And it uses some package-prefix filtering, or else it would be hugely slow.
> Even if the need of an annotation won't be completely eliminated (you
> would still need a package prefix to look for...), maybe another
> annotation, or XmlSeeAlso itself,
> could handle package declarations, and would look in them for subtypes.
>
> Anyway, just dropped a note in case you would find this interesting.


-- 
Kohsuke Kawaguchi