views:

53

answers:

2

Does anybody know of a way to convert xdoclet to annotations in an automated fashion? It seems to me that it should be possible to have equivalent annotations/annotation preprocessors for anything that xdoclet does but manually converting things is really tedious on large systems.

+1  A: 

Offhand I don't know of anything that does this. However, it is possible to write: every JavaDoc object (such as MethodDoc) provides the position() method, which gives the source position of the associated declaration. Read the entire source file into an ArrayList by lines, for each tag prepend the appropriate annotation to the associated line (you don't want to add new lines to the list, because that would throw off the counts), then write the file back out.

An interesting solution, but I suspect that it will be better over the long run to do it manually, one set of tags at a time.

kdgregory
A: 

Did you figure out any way to auto convert xdoclet hibernate to hibernate annotations

Hiber