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).
Constructor and Description |
---|
NewlineAtEndOfFileCheck() |
Modifier and Type | Method and Description |
---|---|
void |
process(File[] aFiles)
Processes a set of files and fires errors to the MessageDispatcher.
|
void |
setLineSeparator(String aLineSeparator)
Sets the line separator to one of 'crlf', 'lf' or 'cr'.
|
destroy, filter, fireErrors, getCharset, getMessageCollector, getMessageDispatcher, log, log, setCharset, setFileExtensions, setMessageDispatcher
getId, getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setId, setSeverity
configure, contextualize, finishLocalSetup, getConfiguration, setupChild
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure
contextualize
public void process(File[] aFiles)
aFiles
- the files to be audited.FileSetCheck.destroy()
public void setLineSeparator(String aLineSeparator)
aLineSeparator
- The line separator to setIllegalArgumentException
- If the specified line separator is not
one of 'crlf', 'lf' or 'cr'