com.puppycrawl.tools.checkstyle.checks

Class NewlineAtEndOfFileCheck

public class NewlineAtEndOfFileCheck extends AbstractFileSetCheck

Checks that there is a newline at the end of each file.

An example of how to configure the check is:

 <module name="NewlineAtEndOfFile"/>

This will check against the platform-specific default line separator.

It is also possible to enforce the use of a specific line-separator across platforms, with the 'lineSeparator' property:

 <module name="NewlineAtEndOfFile">
   <property name="lineSeparator" value="lf"/>
 </module>

Valid values for the 'lineSeparator' property are 'system' (system default), 'crlf' (windows), 'cr' (mac) and 'lf' (unix).

Version: 1.0

Author: Christopher Lenz lkuehne

Method Summary
voidprocess(File[] aFiles)
{@inheritDoc}
voidsetLineSeparator(String aLineSeparator)
Sets the line separator to one of 'crlf', 'lf' or 'cr'.

Method Detail

process

public void process(File[] aFiles)
{@inheritDoc}

setLineSeparator

public void setLineSeparator(String aLineSeparator)
Sets the line separator to one of 'crlf', 'lf' or 'cr'.

Parameters: aLineSeparator The line separator to set

Throws: IllegalArgumentException If the specified line separator is not one of 'crlf', 'lf' or 'cr'