Skip to content

Commit

Permalink
Issue #7614: Update doc for OneTopLevelClass
Browse files Browse the repository at this point in the history
  • Loading branch information
wltan authored and romani committed Mar 8, 2020
1 parent 251bac6 commit abf829f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 28 deletions.
Expand Up @@ -39,7 +39,7 @@
* public class, enum or interface, top-level type is the first type in file.
* </p>
* <p>
* An example of check's configuration:
* To configure the check:
* </p>
* <pre>
* &lt;module name=&quot;OneTopLevelClass&quot;/&gt;
Expand All @@ -52,32 +52,32 @@
* An example of code with violations:
* </p>
* <pre>
* public class Foo{
* //methods
* public class Foo { // OK, first top-level class
* // methods
* }
*
* class Foo2{
* //methods
* class Foo2 { // violation, second top-level class
* // methods
* }
* </pre>
* <p>
* An example of code without public top-level type:
* </p>
* <pre>
* class Foo{ // top-level class
* //methods
* class Foo { // OK, first top-level class
* // methods
* }
*
* class Foo2{
* //methods
* class Foo2 { // violation, second top-level class
* // methods
* }
* </pre>
* <p>
* An example of code without violations:
* </p>
* <pre>
* public class Foo{
* //methods
* public class Foo { // OK, only one top-level class
* // methods
* }
* </pre>
*
Expand Down
40 changes: 23 additions & 17 deletions src/xdocs/config_design.xml
Expand Up @@ -666,7 +666,7 @@ public class StringUtils // not final to allow subclassing

<subsection name="Examples" id="OneTopLevelClass_Examples">
<p>
An example of check's configuration:
To configure the check:
</p>
<source>
&lt;module name="OneTopLevelClass"/&gt;
Expand All @@ -678,35 +678,41 @@ public class StringUtils // not final to allow subclassing
<p>
An example of code with violations:
</p>
<source>
public class Foo{
//methods
<div class="wrapper">
<pre>
public class Foo { // OK, first top-level class
// methods
}

class Foo2{
//methods
class Foo2 { // violation, second top-level class
// methods
}
</source>
</pre>
</div>
<p>
An example of code without public top-level type:
</p>
<source>
class Foo{ // top-level class
//methods
<div class="wrapper">
<pre>
class Foo { // OK, first top-level class
// methods
}

class Foo2{
//methods
class Foo2 { // violation, second top-level class
// methods
}
</source>
</pre>
</div>
<p>
An example of code without violations:
</p>
<source>
public class Foo{
//methods
<div class="wrapper">
<pre>
public class Foo { // OK, only one top-level class
// methods
}
</source>
</pre>
</div>
</subsection>

<subsection name="Example of Usage" id="OneTopLevelClass_Example_of_Usage">
Expand Down

0 comments on commit abf829f

Please sign in to comment.