The moose likes Java in General and the fly likes Don't really Understand what Annotations Are all about Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Don Watch "Don New topic

Don't really Understand what Annotations Are all about

Kevin Simonson
Ranch Hand

Joined: Oct 22, 2011
Posts: 123
Is there some place on the web I can go to understand annotations? I really have no idea what they're about. I look in my existing code and see "@GET" and "@Produces" and "@Path" and "@Context" and "@PathParam", and I just scratch my head and think, "Huh?" Is there some place I can go where the idea gets explained for beginners?

Kevin Simonson
Rob Spoor

Joined: Oct 27, 2005
Posts: 20269

You can start with
However, you won't find the annotations you mentioned there. Those are part of Java EE, and help in setting up RESTful web services. You can find out more about these by looking at their Javadoc pages. You can find all of those except Context in the package.

How To Ask Questions How To Answer Questions
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

"Start with..." is right; that tutorial is pretty sparse. It doesn't really answer the questions "Why would I want to make my own annotations anyway?" and "Okay, suppose I made an annotation, how would I work with it?"
Poornachandra Sarang

Joined: Apr 17, 2012
Posts: 27
I have provided a detailed treatment on annotations including custom annotations, annotating an annotation, and inheriting annotations. All these concepts are explained with appropriate code. It does provide answers to questions like why create your own annotations and many more. I am not sure whether I am allowed to reproduce some text from the book without a prior permission from the publisher.

ps: As pointed out by Rob, the annotations that you are looking for are not part of Java SE and are thus not covered in the book.
I agree. Here's the link:
subject: Don't really Understand what Annotations Are all about
It's not a secret anymore!