Interface FileSetCheck
- All Superinterfaces:
Configurable,Contextualizable
- All Known Implementing Classes:
AbstractFileSetCheck,AbstractHeaderCheck,FileLengthCheck,FileTabCharacterCheck,HeaderCheck,JavadocPackageCheck,LineLengthCheck,MultiFileRegexpHeaderCheck,NewlineAtEndOfFileCheck,OrderedPropertiesCheck,RegexpHeaderCheck,RegexpMultilineCheck,RegexpOnFilenameCheck,RegexpSinglelineCheck,TranslationCheck,TreeWalker,UniquePropertiesCheck
Interface for Checking a set of files for some criteria.
-
Method Summary
Modifier and TypeMethodDescriptionvoidbeginProcessing(String charset) Called when about to be called to process a set of files.voiddestroy()Cleans up the object.voidCalled when all the files have been processed.voidinit()Initialise the instance.Request to process a file.voidsetMessageDispatcher(MessageDispatcher dispatcher) Sets the MessageDispatcher that is used to dispatch audit events to AuditListeners during processing.Methods inherited from interface com.puppycrawl.tools.checkstyle.api.Configurable
configureMethods inherited from interface com.puppycrawl.tools.checkstyle.api.Contextualizable
contextualize
-
Method Details
-
setMessageDispatcher
Sets the MessageDispatcher that is used to dispatch audit events to AuditListeners during processing.- Parameters:
dispatcher- the dispatcher
-
init
void init()Initialise the instance. This is the time to verify that everything required to perform its job. -
destroy
void destroy()Cleans up the object. -
beginProcessing
Called when about to be called to process a set of files.- Parameters:
charset- the character set used to read the files.
-
process
Request to process a file. The implementation should use the supplied contents and not read the contents again. This reduces the amount of file I/O.The file set to process might contain files that are not interesting to the FileSetCheck. Such files should be ignored, no audit event should be fired for them. For example a FileSetCheck that checks java files should ignore HTML or properties files.
The method should return the set of violations to be logged.
- Parameters:
file- the file to be processedfileText- the contents of the file.- Returns:
- the sorted set of violations to be logged.
- Throws:
CheckstyleException- if error condition within Checkstyle occurs
-
finishProcessing
void finishProcessing()Called when all the files have been processed. This is the time to perform any checks that need to be done across a set of files. In this method, the implementation is responsible for the logging of violations.
-