Adding a new xdoclet tag to 1000s of java files

Hi

Need some guidance.

I need to add a new xdoclet tag to a class declaration. I have to do this for 1000s of files. What is the best way to automate this process?

I need to find out the javadoc block just before the class declaration and add a new tag in that block.

/**

  • @foo.persist true

  • @foo.top-level true

  • @foo.date "Jan 1, 2008" //THIS IS THE NEW tag

*/
public interface FooServer extends Server {

}

  • @foo.date "Jan 1, 2008" is the new tag I need to add, but in 1000s of such interfaces.


Any advise is welcome.

2 comments
Comment actions Permalink

If the requirement is really this simple, I would think a quick replace-in-files
using a regular expression would do it?
For example, replace
( @foo.top-level.*)\n
with
$1\n * @foo.date "Jan 1, 2008"


You may get a very few false replacements, but they should trigger compiler
errors, and thus be easy to correct

Regards
Niels

Hi

Need some guidance.

I need to add a new xdoclet tag to a class declaration. I have to do
this for 1000s of files. What is the best way to automate this
process?

I need to find out the javadoc block just before the class declaration
and add a new tag in that block.

/**
*

  • @foo.persist true

  • @foo.top-level true

  • @foo.date "Jan 1, 2008" //THIS IS THE NEW tag

*/
public interface FooServer extends Server {
}

  • @foo.date "Jan 1, 2008" is the new tag I need to add, but in

1000s of such interfaces.

Any advise is welcome.



0
Comment actions Permalink

Hmm

Thanks.

I have to make sure the same pattern exists in each file.

Many thanks - that is a simple solution indeed.

0

Please sign in to leave a comment.