I have a rather big number of source files that I need parse and extract all string literals and put them in a file as play old java constant. For exemple:
Label l = new Label("Cat");
Would become:
Label l = new Label(Constants.CAT);
And in Constants.java I would have:
public final static String CAT = "Cat";
I do not want the strings to be externalized in a property text file. One reason is for consistency and code readability. The other reason is that our client code uses GWT, which does not support Java property text file mechanism.
I could write some sort of parser (using ant replace task maybe)? But I wondered if an IDE already does this sort of thing automatically.