checkstyle/src/xdocs/config_whitespace.xml

1267 lines
46 KiB
XML

<?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 http://maven.apache.org/xsd/xdoc-2.0.xsd">
<properties>
<title>Whitespace</title>
<author>Checkstyle Development Team</author>
</properties>
<body>
<section name="GenericWhitespace">
<subsection name="Description">
<p>
Checks that the whitespace around the Generic tokens &lt; and &gt;
is correct to the <i>typical</i> convention. The convention is not
configurable.
</p>
<p>
For example the following is legal:
</p>
<source>
List&lt;Integer&gt; x = new ArrayList&lt;Integer&gt;();
List&lt;List&lt;Integer&gt;&gt; y = new ArrayList&lt;List&lt;Integer&gt;&gt;();
</source>
<p>
But the following example is not:
</p>
<source>
List &lt; Integer &gt; x = new ArrayList &lt; Integer &gt; ();
List &lt; List &lt; Integer &gt; &gt; y = new ArrayList &lt; List &lt; Integer &gt; &gt; ();
</source>
</subsection>
<subsection name="Properties">
<p>
None.
</p>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;GenericWhitespace&quot;/&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="EmptyForInitializerPad">
<subsection name="Description">
<p>
Checks the padding of an empty for initializer; that is whether
white space is required at an empty for initializer, or such white
space is forbidden. No check occurs if there is a line wrap at the
initializer, as in
</p>
<source>
for (
; i &lt; j; i++, j--)
</source>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>option</td>
<td>policy on how to pad an empty for iterator</td>
<td><a href="property_types.html#parenPad">pad policy</a></td>
<td><code>nospace</code></td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;EmptyForInitializerPad&quot;/&gt;
</source>
<p>
To configure the check to require white space at an empty for
iterator:
</p>
<source>
&lt;module name=&quot;EmptyForInitializerPad&quot;&gt;
&lt;property name=&quot;option&quot; value=&quot;space&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="EmptyForIteratorPad">
<subsection name="Description">
<p>
Checks the padding of an empty for iterator; that is whether white
space is required at an empty for iterator, or such white space is
forbidden. No check occurs if there is a line wrap at the iterator,
as in
</p>
<source>
for (Iterator foo = very.long.line.iterator();
foo.hasNext();
)
</source>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>option</td>
<td>policy on how to pad an empty for iterator</td>
<td><a href="property_types.html#parenPad">pad policy</a></td>
<td><code>nospace</code></td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;EmptyForIteratorPad&quot;/&gt;
</source>
<p>
To configure the check to require white space at an empty for
iterator:
</p>
<source>
&lt;module name=&quot;EmptyForIteratorPad&quot;&gt;
&lt;property name=&quot;option&quot; value=&quot;space&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="MethodParamPad">
<subsection name="Description">
<p>
Checks the padding between the identifier of a method definition,
constructor definition, method call, or constructor invocation; and
the left parenthesis of the parameter list. That is, if the
identifier and left parenthesis are on the same line, checks whether
a space is required immediately after the identifier or such a space
is forbidden. If they are not on the same line, reports an error,
unless configured to allow line breaks. To allow linebreaks after
the identifier, set property <code>allowLineBreaks</code> to <code>
true</code>.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>allowLineBreaks</td>
<td>
whether a line break between the identifier and left parenthesis
is allowed
</td>
<td><a href="property_types.html#boolean">boolean</a></td>
<td><code>false</code></td>
</tr>
<tr>
<td>option</td>
<td>policy on how to pad method parameter</td>
<td>
<a href="property_types.html#parenPad">pad policy</a>
</td>
<td><code>nospace</code></td>
</tr>
<tr>
<td>tokens</td>
<td>tokens to check</td>
<td>
subset of tokens <a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_NEW">LITERAL_NEW</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_CALL">METHOD_CALL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SUPER_CTOR_CALL">SUPER_CTOR_CALL</a>
</td>
<td>
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_NEW">LITERAL_NEW</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_CALL">METHOD_CALL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SUPER_CTOR_CALL">SUPER_CTOR_CALL</a>
</td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;MethodParamPad&quot;/&gt;
</source>
<p>
To configure the check to require a space after the identifier of a
method definition, except if the left parenthesis occurs on a new
line:
</p>
<source>
&lt;module name=&quot;MethodParamPad&quot;&gt;
&lt;property name=&quot;tokens&quot; value=&quot;METHOD_DEF&quot;/&gt;
&lt;property name=&quot;option&quot; value=&quot;space&quot;/&gt;
&lt;property name=&quot;allowLineBreaks&quot; value=&quot;true&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="NoWhitespaceAfter">
<subsection name="Description">
<p>
Checks that there is no whitespace after a token. More specifically,
it checks that it is not followed by whitespace, or (if linebreaks
are allowed) all characters on the line after are whitespace. To
forbid linebreaks after a token, set property <code>allowLineBreaks</code> to <code>
false</code>.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>allowLineBreaks</td>
<td>
whether whitespace is allowed if the token is at a linebreak
</td>
<td><a href="property_types.html#boolean">boolean</a></td>
<td><code>true</code></td>
</tr>
<tr>
<td>tokens</td>
<td>tokens to check</td>
<td>
subset of tokens <a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ARRAY_INIT">ARRAY_INIT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BNOT">BNOT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DEC">DEC</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DOT">DOT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INC">INC</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LNOT">LNOT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#UNARY_MINUS">UNARY_MINUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#UNARY_PLUS">UNARY_PLUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPECAST">TYPECAST</a>
</td>
<td>
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ARRAY_INIT">ARRAY_INIT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BNOT">BNOT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DEC">DEC</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DOT">DOT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INC">INC</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LNOT">LNOT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#UNARY_MINUS">UNARY_MINUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#UNARY_PLUS">UNARY_PLUS</a>
</td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;NoWhitespaceAfter&quot;/&gt;
</source>
<p>
To configure the check to forbid linebreaks after a DOT token:
</p>
<source>
&lt;module name=&quot;NoWhitespaceAfter&quot;&gt;
&lt;property name=&quot;tokens&quot; value=&quot;DOT&quot;/&gt;
&lt;property name=&quot;allowLineBreaks&quot; value=&quot;false&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="NoWhitespaceBefore">
<subsection name="Description">
<p>
Checks that there is no whitespace before a token. More
specifically, it checks that it is not preceded with whitespace, or
(if linebreaks are allowed) all characters on the line before are
whitespace. To allow linebreaks before a token, set property <code>allowLineBreaks</code> to <code>
true</code>.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>allowLineBreaks</td>
<td>
whether whitespace is allowed if the token is at a linebreak
</td>
<td><a href="property_types.html#boolean">boolean</a></td>
<td><code>false</code></td>
</tr>
<tr>
<td>tokens</td>
<td>tokens to check</td>
<td>
subset of tokens <a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SEMI">SEMI</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DOT">DOT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#POST_DEC">POST_DEC</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#POST_INC">POST_INC</a>
</td>
<td>
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SEMI">SEMI</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#POST_DEC">POST_DEC</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#POST_INC">POST_INC</a>
</td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;NoWhitespaceBefore&quot;/&gt;
</source>
<p>
To configure the check to allow linebreaks before a DOT token:
</p>
<source>
&lt;module name=&quot;NoWhitespaceBefore&quot;&gt;
&lt;property name=&quot;tokens&quot; value=&quot;DOT&quot;/&gt;
&lt;property name=&quot;allowLineBreaks&quot; value=&quot;true&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="OperatorWrap">
<subsection name="Description">
<p>
Checks the policy on how to wrap lines on operators.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>option</td>
<td>policy on how to wrap lines</td>
<td>
<a href="property_types.html#wrapOp">wrap operator policy</a>
</td>
<td><code>nl</code></td>
</tr>
<tr>
<td>tokens</td>
<td>tokens to check</td>
<td>
subset of tokens <a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ASSIGN">ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BAND">BAND</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BAND_ASSIGN">BAND_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BOR">BOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BOR_ASSIGN">BOR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BSR">BSR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BSR_ASSIGN">BSR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BXOR">BXOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BXOR_ASSIGN">BXOR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#COLON">COLON</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DIV">DIV</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DIV_ASSIGN">DIV_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#EQUAL">EQUAL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#GE">GE</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#GT">GT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LAND">LAND</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LE">LE</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_INSTANCEOF">LITERAL_INSTANCEOF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LOR">LOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LT">LT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MINUS">MINUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MINUS_ASSIGN">MINUS_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MOD">MOD</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MOD_ASSIGN">MOD_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#NOT_EQUAL">NOT_EQUAL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PLUS">PLUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PLUS_ASSIGN">PLUS_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#QUESTION">QUESTION</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SL">SL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SL_ASSIGN">SL_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SR">SR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SR_ASSIGN">SR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#STAR">STAR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#STAR_ASSIGN">STAR_ASSIGN</a>
</td>
<td>
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BAND">BAND</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BOR">BOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BSR">BSR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BXOR">BXOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#COLON">COLON</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DIV">DIV</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#EQUAL">EQUAL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#GE">GE</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#GT">GT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LAND">LAND</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LE">LE</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_INSTANCEOF">LITERAL_INSTANCEOF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LOR">LOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LT">LT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MINUS">MINUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MOD">MOD</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#NOT_EQUAL">NOT_EQUAL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PLUS">PLUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#QUESTION">QUESTION</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SL">SL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SR">SR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#STAR">STAR</a>
(all tokens except assignment operators)
</td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;OperatorWrap&quot;/&gt;
</source>
<p>
To configure the check for the assignment operator, <code>=</code>, at the end of a line:
</p>
<source>
&lt;module name=&quot;OperatorWrap&quot;&gt;
&lt;property name=&quot;tokens&quot; value=&quot;ASSIGN&quot;/&gt;
&lt;property name=&quot;option&quot; value=&quot;eol&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="ParenPad">
<subsection name="Description">
<p>
Checks the policy on the padding of parentheses; i.e. whether a
space is required after a left parenthesis and before a right
parenthesis, or such spaces are forbidden.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>option</td>
<td>policy on how to pad parentheses</td>
<td><a href="property_types.html#parenPad">pad policy</a></td>
<td><code>nospace</code></td>
</tr>
<tr>
<td>tokens</td>
<td>tokens to check</td>
<td>
subset of tokens <a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_CALL">CTOR_CALL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LPAREN">LPAREN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_CALL">METHOD_CALL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#RPAREN">RPAREN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SUPER_CTOR_CALL">SUPER_CTOR_CALL</a>
</td>
<td>
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_CALL">CTOR_CALL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LPAREN">LPAREN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_CALL">METHOD_CALL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#RPAREN">RPAREN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SUPER_CTOR_CALL">SUPER_CTOR_CALL</a>
</td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;ParenPad&quot;/&gt;
</source>
<p>
To configure the check to require spaces for the parentheses of
constructor, method, and super constructor calls:
</p>
<source>
&lt;module name=&quot;ParenPad&quot;&gt;
&lt;property name=&quot;tokens&quot; value=&quot;CTOR_CALL, METHOD_CALL,
SUPER_CTOR_CALL&quot;/&gt;
&lt;property name=&quot;option&quot; value=&quot;space&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="TypecastParenPad">
<subsection name="Description">
<p>
Checks the policy on the padding of parentheses for typecasts. That
is, whether a space is required after a left parenthesis and before
a right parenthesis, or such spaces are forbidden.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>option</td>
<td>policy on how to pad parentheses</td>
<td><a href="property_types.html#parenPad">pad policy</a></td>
<td><code>nospace</code></td>
</tr>
<tr>
<td>tokens</td>
<td>tokens to check</td>
<td>
Must have tokens
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPECAST">TYPECAST</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#RPAREN">RPAREN</a>
</td>
<td>
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPECAST">TYPECAST</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#RPAREN">RPAREN</a>
</td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;TypecastParenPad&quot;/&gt;
</source>
<p>
To configure the check to require spaces:
</p>
<source>
&lt;module name=&quot;TypecastParenPad&quot;&gt;
&lt;property name=&quot;option&quot; value=&quot;space&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="FileTabCharacter">
<subsection name="Description">
<p>
Checks that there are no tab characters (<code>'\t'</code>) in the source code.
</p>
<p>
Rationale:
</p>
<ul>
<li>
Developers should not need to configure the tab width of their
text editors in order to be able to read source code.
</li>
<li>
From the Apache jakarta coding standards: In a distributed
development environment, when the commit messages get sent
to a mailing list, they are almost impossible to read if you
use tabs.
</li>
</ul>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>eachLine</td>
<td>whether to report on each line containing a tab, or just the first instance</td>
<td><a href="property_types.html#boolean">boolean</a></td>
<td><code>false</code></td>
</tr>
<tr>
<td>fileExtensions</td>
<td>file type extension of files to process</td>
<td><a href="property_types.html#stringSet">String Set</a></td>
<td><code>{}</code></td>
</tr>
</table>
</subsection>
<subsection name="Example">
<p>
To configure the check to report on the first instance in each
file:
</p>
<source>
&lt;module name=&quot;FileTabCharacter&quot;/&gt;
</source>
<p>
To configure the check to report on each line in each file:
</p>
<source>
&lt;module name=&quot;FileTabCharacter&quot;&gt;
&lt;property name=&quot;eachLine&quot; value=&quot;true&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#Checker">Checker</a>
</p>
</subsection>
</section>
<section name="WhitespaceAfter">
<subsection name="Description">
<p>
Checks that a token is followed by whitespace.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>tokens</td>
<td>tokens to check</td>
<td>
subset of tokens <a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#COMMA">COMMA</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SEMI">SEMI</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPECAST">TYPECAST</a>
</td>
<td>
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#COMMA">COMMA</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SEMI">SEMI</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPECAST">TYPECAST</a>
</td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;WhitespaceAfter&quot;/&gt;
</source>
<p>
To configure the check for whitespace only after COMMA and SEMI
tokens:
</p>
<source>
&lt;module name=&quot;WhitespaceAfter&quot;&gt;
&lt;property name=&quot;tokens&quot; value=&quot;COMMA, SEMI&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="WhitespaceAround">
<subsection name="Description">
<p>
Checks that a token is surrounded by whitespace. Empty constructor and
method bodies (blocks) of the form
</p>
<source>public MyClass() {} // empty constructor
public void func() {} // empty method</source>
<p>
may optionally be exempted from the policy using the <code>
allowEmptyMethods</code> and <code>allowEmptyConstructors
</code> properties.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>tokens</td>
<td>tokens to check</td>
<td>
subset of tokens <a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ASSIGN">ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BAND">BAND</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BAND_ASSIGN">BAND_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BOR">BOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BOR_ASSIGN">BOR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BSR">BSR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BSR_ASSIGN">BSR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BXOR">BXOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#BXOR_ASSIGN">BXOR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#COLON">COLON</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DIV">DIV</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#DIV_ASSIGN">DIV_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#EQUAL">EQUAL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#GE">GE</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#GT">GT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LAND">LAND</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LCURLY">LCURLY</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LE">LE</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_ASSERT">LITERAL_ASSERT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_CATCH">LITERAL_CATCH</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_DO">LITERAL_DO</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_ELSE">LITERAL_ELSE</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_FINALLY">LITERAL_FINALLY</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_FOR">LITERAL_FOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_IF">LITERAL_IF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_RETURN">LITERAL_RETURN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_SYNCHRONIZED">LITERAL_SYNCHRONIZED</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_TRY">LITERAL_TRY</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LITERAL_WHILE">LITERAL_WHILE</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LOR">LOR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#LT">LT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MINUS">MINUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MINUS_ASSIGN">MINUS_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MOD">MOD</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#MOD_ASSIGN">MOD_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#NOT_EQUAL">NOT_EQUAL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PLUS">PLUS</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PLUS_ASSIGN">PLUS_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#QUESTION">QUESTION</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#RCURLY">RCURLY</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SL">SL</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SLIST">SLIST</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SL_ASSIGN">SL_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SR">SR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#SR_ASSIGN">SR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#STAR">STAR</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#STAR_ASSIGN">STAR_ASSIGN</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#TYPE_EXTENSION_AND">TYPE_EXTENSION_AND</a>
</td>
<td>all tokens</td>
</tr>
<tr>
<td>allowEmptyConstructors</td>
<td>allow empty constructor bodies</td>
<td><a href="property_types.html#boolean">boolean</a></td>
<td><code>false</code></td>
</tr>
<tr>
<td>allowEmptyMethods</td>
<td>allow empty method bodies</td>
<td><a href="property_types.html#boolean">boolean</a></td>
<td><code>false</code></td>
</tr>
<tr>
<td>ignoreEnhancedForColon</td>
<td>ignore whitespace around colon in for-each loops</td>
<td><a href="property_types.html#boolean">boolean</a></td>
<td><code>true</code></td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
To configure the check:
</p>
<source>
&lt;module name=&quot;WhitespaceAround&quot;/&gt;
</source>
<p>
To configure the check for whitespace around the assignment
operator, <code>=</code>:
</p>
<source>
&lt;module name=&quot;WhitespaceAround&quot;&gt;
&lt;property name=&quot;tokens&quot; value=&quot;ASSIGN&quot;/&gt;
&lt;/module&gt;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks.whitespace
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
<section name="NoLineWrap">
<subsection name="Description">
<p>
Checks that chosen statements are not line-wrapped. By default this
Check restricts wrapping import and package statements, but it's possible to check
any statement.
</p>
</subsection>
<subsection name="Properties">
<table>
<tr>
<th>name</th>
<th>description</th>
<th>type</th>
<th>default value</th>
</tr>
<tr>
<td>tokens</td>
<td>assignments to check</td>
<td>subset of tokens <a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PACKAGE_DEF">PACKAGE_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#IMPORT">IMPORT</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CLASS_DEF">CLASS_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#ENUM_DEF">ENUM_DEF</a>
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#INTERFACE_DEF">INTERFACE_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#CTOR_DEF">CTOR_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#METHOD_DEF">METHOD_DEF</a>,
</td>
<td><a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#PACKAGE_DEF">PACKAGE_DEF</a>,
<a
href="apidocs/com/puppycrawl/tools/checkstyle/api/TokenTypes.html#IMPORT">IMPORT</a></td>
</tr>
</table>
</subsection>
<subsection name="Examples">
<p>
Examples of line-wrapped statements (bad case):
</p>
<source>
package com.puppycrawl.
tools.checkstyle.checks;
import com.puppycrawl.tools.
checkstyle.api.Check;
</source>
<p>
To configure the check to force no line-wrapping
in package and import statements (default values):
</p>
<source>
&lt;module name=&quot;NoLineWrap&quot;/&gt;
</source>
<p>
To configure the check to force no line-wrapping only
in import statements:
</p>
<source>
&lt;module name=&quot;NoLineWrap&quot;&gt;
&lt;property name="tokens" value="IMPORT"&gt;
&lt;/module&gt;
</source>
<p>
Examples of not line-wrapped statements (good case):
</p>
<source>
import com.puppycrawl.tools.checkstyle.api.Check;
</source>
</subsection>
<subsection name="Package">
<p>
com.puppycrawl.tools.checkstyle.checks
</p>
</subsection>
<subsection name="Parent Module">
<p>
<a href="config.html#TreeWalker">TreeWalker</a>
</p>
</subsection>
</section>
</body>
</document>