aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjack870131 <jack870131@outlook.com>2018-09-02 23:55:33 +0800
committerRoman Ivanov <romani@users.noreply.github.com>2018-09-12 05:59:46 -0700
commitddca12405837519c6491328096a7443a0d2fd945 (patch)
treeeaac44329ecd4da35ef9ceb75ce319d619038d30
parentd35ba9c4b65353fb9fff4cf5a086a70b5078c44c (diff)
downloadcheckstyle-ddca12405837519c6491328096a7443a0d2fd945.tar.gz
Issue #5832: Add javadoc and xdoc Example for AbstractClassName
-rw-r--r--src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java9
-rw-r--r--src/xdocs/config_naming.xml7
2 files changed, 14 insertions, 2 deletions
diff --git a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java
index 48d2cb5b5..7d3450ff0 100644
--- a/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java
+++ b/src/main/java/com/puppycrawl/tools/checkstyle/checks/naming/AbstractClassNameCheck.java
@@ -55,13 +55,18 @@ import com.puppycrawl.tools.checkstyle.api.TokenTypes;
* The following example shows how to configure the {@code AbstractClassName} to
* checks names, but ignore missing {@code abstract} modifiers:
* </p>
- *
+ * <p>Configuration:</p>
* <pre>
* &lt;module name="AbstractClassName"&gt;
* &lt;property name="ignoreModifier" value="true"/&gt;
* &lt;/module&gt;
* </pre>
- *
+ * <p>Example:</p>
+ * <pre>
+ * abstract class AbstractFirstClass {} // OK
+ * abstract class SecondClass {} // violation, it should match the pattern "^Abstract.+$"
+ * class AbstractThirdClass {} // OK, no "abstract" modifier
+ * </pre>
* @since 3.2
*/
@StatelessCheck
diff --git a/src/xdocs/config_naming.xml b/src/xdocs/config_naming.xml
index d5cefb1d7..03adf10f2 100644
--- a/src/xdocs/config_naming.xml
+++ b/src/xdocs/config_naming.xml
@@ -270,11 +270,18 @@
<code>AbstractClassName</code> to checks names, but ignore
missing <code>abstract</code> modifiers:
</p>
+ <p>Configuration:</p>
<source>
&lt;module name=&quot;AbstractClassName&quot;&gt;
&lt;property name=&quot;ignoreModifier&quot; value=&quot;true&quot;/&gt;
&lt;/module&gt;
</source>
+ <p>Example:</p>
+ <pre>
+abstract class AbstractFirstClass {} // OK
+abstract class SecondClass {} // violation, it should match the pattern "^Abstract.+$"
+class AbstractThirdClass {} // OK, no "abstract" modifier
+ </pre>
</subsection>
<subsection name="Example of Usage" id="AbstractClassName_Example_of_Usage">