-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
innertypelast.xml
88 lines (81 loc) · 2.8 KB
/
innertypelast.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?xml version="1.0" encoding="UTF-8"?>
<document xmlns="http://maven.apache.org/XDOC/2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/XDOC/2.0 https://maven.apache.org/xsd/xdoc-2.0.xsd">
<head>
<title>InnerTypeLast</title>
</head>
<body>
<section name="InnerTypeLast">
<p>Since Checkstyle 5.2</p>
<subsection name="Description" id="Description">
<p>
Checks nested (internal) classes/interfaces are declared at the bottom of the
primary (top-level) class after all init and static init blocks,
method, constructor and field declarations.
</p>
</subsection>
<subsection name="Examples" id="Examples">
<p id="Example1-config">
To configure the check:
</p>
<source>
<module name="Checker">
<module name="TreeWalker">
<module name="InnerTypeLast"/>
</module>
</module>
</source>
<p id="Example1-code">Example:</p>
<source>
class Test {
private String s; // OK
class InnerTest1 {}
public void test() {} // violation, method should be declared before inner types.
}
class Test2 {
static {}; // OK
class InnerTest1 {}
public Test2() {} // violation, constructor should be declared before inner types.
}
class Test3 {
private String s; // OK
public void test() {} // OK
class InnerTest1 {}
}
</source>
</subsection>
<subsection name="Example of Usage" id="Example_of_Usage">
<ul>
<li>
<a href="https://github.com/search?q=path%3Aconfig%20path%3A**%2Fcheckstyle-checks.xml+repo%3Acheckstyle%2Fcheckstyle+InnerTypeLast">
Checkstyle Style</a>
</li>
</ul>
</subsection>
<subsection name="Violation Messages" id="Violation_Messages">
<ul>
<li>
<a href="https://github.com/search?q=path%3Asrc%2Fmain%2Fresources%2Fcom%2Fpuppycrawl%2Ftools%2Fcheckstyle%2Fchecks%2Fdesign%20path%3A**%2Fmessages*.properties+repo%3Acheckstyle%2Fcheckstyle+%22arrangement.members.before.inner%22">
arrangement.members.before.inner</a>
</li>
</ul>
<p>
All messages can be customized if the default message doesn't suit you.
Please <a href="../../config.html#Custom_messages">see the documentation</a>
to learn how to.
</p>
</subsection>
<subsection name="Package" id="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.design
</p>
</subsection>
<subsection name="Parent Module" id="Parent_Module">
<p>
<a href="../../config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
</body>
</document>