WhitespaceAroundCheck.java | Class |
Checks that a token is surrounded by whitespace.
By default the check will check the following operators:
TokenTypes.LITERAL_ASSERT ASSERT ,
TokenTypes.ASSIGN ASSIGN ,
TokenTypes.BAND BAND ,
TokenTypes.BAND_ASSIGN BAND_ASSIGN ,
TokenTypes.BOR BOR ,
TokenTypes.BOR_ASSIGN BOR_ASSIGN ,
TokenTypes.BSR BSR ,
TokenTypes.BSR_ASSIGN BSR_ASSIGN ,
TokenTypes.BXOR BXOR ,
TokenTypes.BXOR_ASSIGN BXOR_ASSIGN ,
TokenTypes.COLON COLON ,
TokenTypes.DIV DIV ,
TokenTypes.DIV_ASSIGN DIV_ASSIGN ,
TokenTypes.EQUAL EQUAL ,
TokenTypes.GE GE ,
TokenTypes.GT GT ,
TokenTypes.LAND LAND ,
TokenTypes.LCURLY LCURLY ,
TokenTypes.LE LE ,
TokenTypes.LITERAL_CATCH LITERAL_CATCH ,
TokenTypes.LITERAL_DO LITERAL_DO ,
TokenTypes.LITERAL_ELSE LITERAL_ELSE ,
TokenTypes.LITERAL_FINALLY LITERAL_FINALLY ,
TokenTypes.LITERAL_FOR LITERAL_FOR ,
TokenTypes.LITERAL_IF LITERAL_IF ,
TokenTypes.LITERAL_RETURN LITERAL_RETURN ,
TokenTypes.LITERAL_SYNCHRONIZED LITERAL_SYNCHRONIZED ,
TokenTypes.LITERAL_TRY LITERAL_TRY ,
TokenTypes.LITERAL_WHILE LITERAL_WHILE ,
TokenTypes.LOR LOR ,
TokenTypes.LT LT ,
TokenTypes.MINUS MINUS ,
TokenTypes.MINUS_ASSIGN MINUS_ASSIGN ,
TokenTypes.MOD MOD ,
TokenTypes.MOD_ASSIGN MOD_ASSIGN ,
TokenTypes.NOT_EQUAL NOT_EQUAL ,
TokenTypes.PLUS PLUS ,
TokenTypes.PLUS_ASSIGN PLUS_ASSIGN ,
TokenTypes.QUESTION QUESTION ,
TokenTypes.RCURLY RCURLY ,
TokenTypes.SL SL ,
TokenTypes.SLIST SLIST ,
TokenTypes.SL_ASSIGN SL_ASSIGN ,
TokenTypes.SR SR ,
TokenTypes.SR_ASSIGN SR_ASSIGN ,
TokenTypes.STAR STAR ,
TokenTypes.STAR_ASSIGN STAR_ASSIGN .
TokenTypes.LITERAL_ASSERT LITERAL_ASSERT .
TokenTypes.GENERIC_START GENERIC_START .
TokenTypes.GENERIC_END GENERIC_END .
TokenTypes.TYPE_EXTENSION_AND TYPE_EXTENSION_AND .
TokenTypes.WILDCARD_TYPE WILDCARD_TYPE .
An example of how to configure the check is:
<module name="WhitespaceAround"/>
An example of how to configure the check for whitespace only around
assignment operators is:
<module name="WhitespaceAround">
<property name="tokens"
value="ASSIGN,DIV_ASSIGN,PLUS_ASSIGN,MINUS_ASSIGN,STAR_ASSIGN,MOD_ASSIGN,SR_ASSIGN,BSR_ASSIGN,SL_ASSIGN,BXOR_ASSIGN,BOR_ASSIGN,BAND_ASSIGN"/>
</module>
In addition, this check can be configured to allow empty method and/or
constructor bodies. |