The Java language does not support auto-generation.
Rather, auto-generation is / would be implemented by a tool such as your IDE. So what you should be doing is look at your IDE's mechanisms for auto-generating code. These will depend on what IDE you are using.
For example, in Eclipse, you can define custom code templates to do this kind of thing.