Skip to main content

@Documented

3 replies [Last post]
alexlamsl
Offline
Joined: 2004-09-02

What does it do?

Quoted from its Javadoc:

Indicates that annotations with a type are to be documented by javadoc and similar tools by default. This type should be used to annotate the declarations of types whose annotations affect the use of annotated elements by their clients. If a type declaration is annotated with Documented, its annotations become part of the public API of the annotated elements.

Ok I admit that I'm not a native english speaker, but those "annotate"'s are really confusing me here...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
alexlamsl
Offline
Joined: 2004-09-02

Ah Ha :)

I'd better put that on some of my annotations then - I've always assumed that the javadoc tools deals with the standard annotations in specific, hard-coded ways...

prunge
Offline
Joined: 2004-05-06

@Documented is used when writing your own annotations. When used on an annotation, javadoc will document that fact.

For example the @Deprecated annotation is marked with @Documented so Javadoc will advertise the fact that a method is deprecated when marked with this annotation. @Override is not marked with @Documented so this annotation is ignored by javadoc and is not generated into the documentation.

alexlamsl
Offline
Joined: 2004-09-02

2nd read into my own post, it sounds more like a homework task :D

Basically, I ran into it while I was explaining to my friend the world of Annotations as I'm using @Override all over the place. I went round the standard annotations, but then I noticed @Target is annotated by this @Documented (and oh it is annotated by itself as well!) but have not a single clue what it means even after reading though the docs.

Since I haven't seen anyone using it so far, it's probably not a popularly useful thing to most people. But occasional curiosity isn't a Bad Thing, is it? ;)