Kohsuke Kawaguchi a écrit :
> Benoit Callebaut wrote:
>
>> Hello,
>> I have written a JAXB plugin that allow to embed a Jelly script in an
>> *.xsd file.
>> Jelly is a scripting engine used by maven for exemple. With it, you
>> can generate dynamically source code.
>
>
> I know enough about Jelly --- I've been using it a lot in various
> places, including the documentation and sample generation in the JAXB
> RI :-)
>
> I'm curious what your plugin really does. Is it that you run Jelly to
> generate the source code fragment, then inject that to the generated
> class by using the "direct" statements?
That is how it works today. But I plan to expand it.
Some of the ideas are :
* Implement JAXB specific tag libraries
* Be able to call a script from a "script registry". For example to
automatically add indexing code or key generation code
* Post process the code model using XSL like scripts
* Insert Java code as XML tags
* Parametrizable scripts through system properties,arguments or even
better through tags inserted in the POM file
>
> It would be really interesting if the Jelly script has access to the
> object model inside the schema compiler. Then it can work like a
> meta-plugin, in a way.
I am currently trying this approach. I can already use classes declared
as dependencies in my plugin. I have still to define a way tofor my
plugin to detect the classes that are usable. (same approach as the JAXB
plugins for example)
>
>> At the moment my plugin is only a proof of concept and is far from
>> being fully tested but It can alredy do more than the code injector
>> plugin.
>>
>> If somebody is interested, I am ready to put it on jaxb2-commons.
>
>
> Definitely! Please tell me your java.net ID so that I can add you.
Here is my login : bencal