Class SeparatorWrapCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class SeparatorWrapCheck
    extends AbstractCheck

    Checks line wrapping with separators. The policy to verify is specified using the WrapOption class and defaults to WrapOption.EOL.

    By default the check will check the following separators: DOT, COMMA, Other acceptable tokens are SEMI, ELLIPSIS, AT, LPAREN, RPAREN, ARRAY_DECLARATOR, RBRACK,

    Code example for comma and dot at the new line:

     s
        .isEmpty();
     foo(i
        ,s);
     

    An example of how to configure the check is:

     <module name="SeparatorWrap"/>
     

    Code example for comma and dot at the previous line:

     s.
        isEmpty();
     foo(i,
        s);
     

    An example of how to configure the check for comma at the new line is:

     <module name="SeparatorWrap">
         <property name="tokens" value="COMMA"/>
         <property name="option" value="nl"/>
     </module>
     
    Author:
    maxvetrenko