Am Donnerstag, 5. Juli 2012 14:30:01 UTC+2 schrieb Lukas Eder:

> Considering everything, I see only one options: 
> > 
> > Write a tool that "clones" the project and strips all the methods that 
> we 
> > don't want. So you'd run the tool and you'd get a *new* Maven project 
> which 
> > contains only the code that you want. Should be pretty simple to do with 
> the 
> > AST parser that I posted about since you'd just have to copy any 
> non-java 
> > file and filter the methods by annotations and then create a new source 
> file 
> > with toString() (more or less). 
>
> That won't work for two reasons: [...] 

 

> > - Create one interface per database and implement that or use a clever 
> proxy 
> > handler -> doesn't work because of the static methods. 
>
> ...and because I won't spend time maintaining such a solution. 
>

What time? The interfaces could be generated automatically from the 
annotations.
 

> > - Strip the code inline -> That would either confuse Eclipse (you can't 
> edit 
> > the original source code anymore) or Maven (generating source code into 
> the 
> > folder src/*/java isn't defined behavior). 
>
> I'm not sure what that means. 
>

Some of the Maven plugins will get confused when you change the files in 
src/*/java after you started Maven. I don't know which ones but changing 
those files is asking for trouble. Eventually, you will run into problems 
because no one expects that this could happen.

Which means you will need to copy the jOOQ sources into a different folder 
(say, "template/") and generate the sources from there into 
"target/generated-sources/". "template/" can't be a source folder (neither 
m2e nor Maven support this). Which would mean you couldn't edit the 
original sources in the Java editor anymore.

My conclusion: Nice idea, impossible to implement in Java. With Xtend, it 
would be a couple of hours of work but that doesn't help :-)

Regards,

A. Digulla

Reply via email to