代码
import java.lang.annotation.Documented;
@Documented
public @interface MyDocumentedtAnnotation {
}
@MyDocumentedtAnnotation
public class DocumentedAnnotationTest {
private String name;
public DocumentedAnnotationTest() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "DocumentedAnnotationTest{" +
"name='" + name + '\'' +
'}';
}
}
import java.lang.annotation.Documented;
@Documented
public @interface MyDocumentedtAnnotation2 {
String key() default "key";
String str();
String[] strArr();
}
@MyDocumentedtAnnotation2(str = "wwj", strArr = {"str1", "str2"})
public class DocumentedAnnotationTest2 {
private String name;
public DocumentedAnnotationTest2() {
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "DocumentedAnnotationTest{" +
"name='" + name + '\'' +
'}';
}
}
生成JavaDoc
这里我选择生成的文档为doucumented包下的有@Documented的java
生成的文档