O'Reilly logo

Java EE 6 Development with NetBeans 7 by David R. Heffelfinger

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Stereotypes

A CDI stereotype allows us to create new annotations that bundle together several CDI annotations. For example, if we needed to create several CDI named beans with a scope of session, we would have to use two annotations in each of these beans, namely @Named and @SessionScoped. Instead of having to add two annotations to each of our beans, we could create a stereotype, and then annotate our beans with it.

To create a CDI stereotype in NetBeans, we simply need to create a new file, selecting the Contexts and Dependency Injection category and the Stereotype file type.

Stereotypes

We then need to enter a name and package for our new Stereotype.

At this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required