Over a million developers have joined DZone.

An Eclipse Template for Creating Annotations

· Java Zone

Discover how AppDynamics steps in to upgrade your performance game and prevent your enterprise from these top 10 Java performance problems, brought to you in partnership with AppDynamics.

If/when you start doing Java EE 6 (spec lead from Oracle insisted that I use this means of referring to the latest release, by telling me that JEE6 does not exist, which I took some philosophical amusement in, given that language is not often about an arbiter making an existential argument for the referent), you will be making a lot of annotations. Repositories, qualifiers for injections, etc.

The Weld archetype comes with a bunch in place that I noted use static imports for the constants that are required. If you then go and make your own, since eclipse‘s import mechanism is still not bright enough to deal with static imports, you will no doubt end up with ElementType and RetentionPolicy clogging up your already seriously ugly declaration space.

So here is a template that just makes the whole annotation, including the package statement, and then drops you into the JavaDoc block where you can state your intentions and move on.

XML of eclipse template

 

From http://www.jroller.com/robwilliams/entry/an_eclipse_template_for_creating

The Java Zone is brought to you in partnership with AppDynamics. AppDynamics helps you gain the fundamentals behind application performance, and implement best practices so you can proactively analyze and act on performance problems as they arise, and more specifically with your Java applications. Start a Free Trial.

Topics:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}