Eclipse - auto generate class Javadoc using class name manipulation
I want to generate Javadoc every creation of new file with class name as words, meaning separated by space before each uppercase, for example
When creating class NewJavaClass.java it will create java docs as:
/** * New Java Class * /* public class NewJavaClass
- Go to
code templateson the left top search box.
- Go to
Java Code Templates.
- On the right side select
New Java filesthen click Edit.
- Now You can paste the code that you want while creating new java file. Don't forget to save. Now you can check by creating new java file.
- Go to
Code templates are limited to simple variable substitution. Some of variables do accept arguments to manipulate the output in certain ways (e.g.
currentDatecan be configured with a date format pattern) but none of the built-in variables allow you to do complex string manipulation. You most certainly need a plugin to achieve what you want.
You should look for plugins that let you define more complex class templates. After a quick search I found the FastCode Eclipse plugin which looks like it allows you to create custom templates in some template language. The screenshots look quite dated though and the website doesn't say Eclipse versions are supported.
You can also write a plugin yourself. It should be possible to provide some simple custom variables for templates. Or write a plugin that provides a file creation wizard which gives you complete control over the generated class. Another option would be to write a plugin that extends the editor with custom content assist (code completion) to generate code or documentation in existing files.