Hi,

You should try to use new JDK 1.6 annotation processor utilities. The only 
constraint I see is that each class you want to "parse" must be annotated.

Regards,

Julien



----- Message d'origine ----
> De : "Lewis, Eric" <[email protected]>
> À : "[email protected]" <[email protected]>
> Envoyé le : Jeu 13 janvier 2011, 16h 48min 14s
> Objet : How to write a plugin that generates source files based on the source 
>in the project?
> 
> Hi
> 
> I'm trying to write a plugin which does the following:
> 
> - Check  the classes in the project and keep all classes that implement 
>interface X.
> -  For all X, get the fields, and if a field has a certain annotation, 
> generate 
>a  class containing some constant information.
> 
> Normally the plugin should be  bound to the phase 'generate-sources'. 
> However, 
>the classes of the project  aren't compiled yet at that moment, so I can't 
>just 
>get them from the classpath,  right?
> 
> Does anyone have a good idea or pointers how to do this  correctly?
> 
> Thanks & best  regards,
> Eric
> 
> ---------------------------------------------------------------------
> To  unsubscribe, e-mail: [email protected]
> For  additional commands, e-mail: [email protected]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to