Most of the IDE gives some templates or insert code options. In netbeans IDE option like "right click in any java source page" then "insert code or (alt+insert)" then we can choose like "constructor","getter setter method" or "tostring method"...etc and if a user does not fulfill it's requirement. For example my requirement is like generated constructor, it's data member must be final or if i want to add some extra code at the generation time. i was going through following steps below
- File -> New Project -> NetBeans Modules -> Module
- New -> Other -> Module Development -> Code Generator.
it is available in this link.
Then run the project. It will open a new netbeans window -->new project-->java application --> create a classfile--> right click on page --> it will show new option like sample generator. Then will generate a method. So my requirement is when i click sample generator, it will generate a constructor according to my specification and requirement.
let me show you what i am getting. some screen shoot.
First:
Second: