I was hoping to find a way to automatically generate some code based on existing code. The actual functionality would be very similar to javadoc or in this case IDLdoc or to automatic get/set functions.

I want to create some generic code based on some already listed parameters. How do I accomplish this within eclipse?

I think an example would be best, so here is what I would like to accomplish:

keyword1: stuffIdontCareAbout, $;comments
keyword2: otherStuffIdontCareAbout, $;more comments
keyword3: lastStuffIdontCareAbout $

What do I need to do in eclipse so that I can have eclipse quickly parse the above block and output the following for another part of the code?

KEYWORD1=inp_keyword1, KEYWORD2=inp_keyword2, KEYWORD3=inp_keyword3

Thanks

有帮助吗?

解决方案

My usual knee-jerk response is to suggest that you use JET as that what it's designed for.

For this specific case, however, you might be better off just writing a simple popup action (use the new plugin project with the popup action template) that parses the properties file (looks simple enough to do in Java) and writes out the target code to another file, the console or, if you're clever, back into an existing file in the right place.

Once you have the plugin generated for you with the template, the rest should be simple Java.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top