diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java index 6381efcac63..286167a5da3 100644 --- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java +++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/MissingJavadocTypeCheck.java @@ -53,7 +53,8 @@ * *
- * Example that allows missing comments for classes annotated with {@code @SpringBootApplication} - * and {@code @Configuration}: + * To configure a check that allows missing comments for classes annotated + * with {@code @SpringBootApplication} and {@code @Configuration}: + *
+ *+ * <module name="MissingJavadocType"> + * <property name="skipAnnotations" value="SpringBootApplication,Configuration"/> + * </module> + *+ *
+ * Example: *
** @SpringBootApplication // no violations about missing comment on class @@ -137,14 +146,28 @@ * class DatabaseConfiguration {} **
- * Use following configuration: + * To configure a check that allows missing comments for classes annotated with {@code @Annotation} + * and {@code @MyClass.Annotation}: *
** <module name="MissingJavadocType"> - * <property name="skipAnnotations" value="SpringBootApplication,Configuration"/> + * <property name="skipAnnotations" value="Annotation,MyClass.Annotation"/> * </module> **
+ * Example: + *
+ *+ * @Annotation // ok + * class Class1 {} + * + * @MyClass.Annotation // ok + * class Class2 {} + * + * @com.mycompany.MyClass.Annotation // violation, as this form is missed in config + * class Class3 {} + *+ *
* Parent is {@code com.puppycrawl.tools.checkstyle.TreeWalker} *
*
@@ -174,7 +197,8 @@ public class MissingJavadocTypeCheck extends AbstractCheck {
/**
* Specify annotations that allow missed documentation.
- * Only short names are allowed, e.g. {@code Generated}.
+ * If annotation is present in target sources in multiple forms of qualified
+ * name, all forms should be listed in this property.
*/
private Set
- Example that allows missing comments for classes annotated with
+ To configure a check that allows missing comments for classes annotated with
Example: Use following configuration: To configure a check that allows missing comments for classes annotated with
+
+ Example:
+
specify annotations that allow missed documentation.
- Only short names are allowed, e.g.
Generated
.
+ If annotation is present in target sources in multiple forms of qualified
+ name, all forms should be listed in this property.
String[]
@@ -2979,23 +2980,44 @@ protected class PublicClass {}
class PackagePrivateClass {}
- Generated
@SpringBootApplication
and @Configuration
:
@Annotation
and @MyClass.Annotation
:
+