Stay organized with collections
Save and categorize content based on your preferences.
Documented
public
abstract
@interface
Documented
implements
Annotation
java.lang.annotation.Documented
|
If the annotation @Documented
is present on the declaration
of an annotation interface A, then any @A
annotation on
an element is considered part of the element's public contract.
In more detail, when an annotation interface A is annotated with
Documented
, the presence and value of A annotations
are a part of the public contract of the elements A
annotates.
Conversely, if an annotation interface B is not
annotated with Documented
, the presence and value of
B annotations are not part of the public contract
of the elements B annotates.
Concretely, if an annotation interface is annotated with Documented
,
by default a tool like javadoc will display annotations of that interface
in its output while annotations of annotation interfaces without
Documented
will not be displayed.
Summary
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# Documented\n\nAdded in [API level 1](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Inherited Methods](#inhmethods) \n\nDocumented\n==========\n\n\n`\npublic\n\n\nabstract\n@interface\nDocumented\n`\n\n\n`\n\n\nimplements\n\n`[Annotation](/reference/java/lang/annotation/Annotation)`\n\n\n`\n\n|---------------------------------|\n| java.lang.annotation.Documented |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nIf the annotation `@Documented` is present on the declaration\nof an annotation interface *A* , then any `@A` annotation on\nan element is considered part of the element's public contract.\n\nIn more detail, when an annotation interface *A* is annotated with\n`Documented`, the presence and value of *A* annotations\nare a part of the public contract of the elements *A*\nannotates.\n\nConversely, if an annotation interface *B* is *not*\nannotated with `Documented`, the presence and value of\n*B* annotations are *not* part of the public contract\nof the elements *B* annotates.\n\nConcretely, if an annotation interface is annotated with `Documented`,\nby default a tool like javadoc will display annotations of that interface\nin its output while annotations of annotation interfaces without\n`Documented` will not be displayed.\n\nSummary\n-------\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[java.lang.annotation.Annotation](/reference/java/lang/annotation/Annotation)` ` |-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[Class](/reference/java/lang/Class)`\u003c? extends `[Annotation](/reference/java/lang/annotation/Annotation)`\u003e` | ` `[annotationType](/reference/java/lang/annotation/Annotation#annotationType())`() ` Returns the annotation interface of this annotation. | | ` abstract boolean` | ` `[equals](/reference/java/lang/annotation/Annotation#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Returns true if the specified object represents an annotation that is logically equivalent to this one. | | ` abstract int` | ` `[hashCode](/reference/java/lang/annotation/Annotation#hashCode())`() ` Returns the hash code of this annotation. | | ` abstract `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/annotation/Annotation#toString())`() ` Returns a string representation of this annotation. | ||"]]