Java Annotation @Documented

The @Documented annotation is a standard Java annotation that is used to indicate that an annotation should be included in the JavaDoc documentation generated for the annotated element.

When you use the @Documented annotation, any JavaDoc comments for the annotated element will include information about the annotation. This can be useful for developers who are using your code and need to understand the purpose and usage of your annotations.

Here is an example of how to use the @Documented annotation:

refer to‮tfigi:‬idea.com
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface MyAnnotation {
  // annotation elements
}

In this example, the MyAnnotation annotation is annotated with @Documented to indicate that it should be included in the JavaDoc documentation generated for the annotated element.

When you use the @Documented annotation, it is important to ensure that your annotation has useful JavaDoc comments. The comments should explain the purpose and usage of the annotation, and provide any relevant examples or usage information. By using the @Documented annotation, you can help to ensure that your annotations are well-documented and easy to use.