@Documented
时间: 2024-01-19 22:03:32 浏览: 16
@Documented is a Java annotation that indicates that the annotated element's documentation should be included in the generated JavaDoc. This annotation has no effect on the runtime behavior of the code; it solely affects the documentation that is generated from the code.
When a class or method is annotated with @Documented, its documentation will be included in the JavaDoc even if it does not have any other JavaDoc comments. This can be useful for providing additional context or explanation for the code.
For example, the following code defines a class with a single method annotated with @Documented:
```
/**
* This class provides a simple example of using the @Documented annotation.
*
* @author John Smith
*/
@Documented
public class Example {
/**
* This method does something interesting.
*/
@Documented
public void doSomething() {
// ...
}
}
```
When the JavaDoc is generated for this class, the documentation for the doSomething() method will be included even though it does not have its own JavaDoc comments.