Using well-established Design Patterns (GoF, EJB) to create model elements has been available in the NetBeans UML for quite some time. See the following article for using these design patterns.
Designing Patterns With UML
To make this feature even more useful, you can create your own custom design patterns and use them to generate model elements which can then generate source for you. Download the attached PDF file for full details.
Creating and Using Custom Design Pattern Demo Script