Interface FileSetCheck
-
- All Superinterfaces:
Configurable,Contextualizable
- All Known Implementing Classes:
AbstractFileSetCheck,AbstractHeaderCheck,FileLengthCheck,FileTabCharacterCheck,HeaderCheck,JavadocPackageCheck,LineLengthCheck,NewlineAtEndOfFileCheck,OrderedPropertiesCheck,RegexpHeaderCheck,RegexpMultilineCheck,RegexpOnFilenameCheck,RegexpSinglelineCheck,TranslationCheck,TreeWalker,UniquePropertiesCheck
public interface FileSetCheck extends Configurable, Contextualizable
Interface for Checking a set of files for some criteria.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbeginProcessing(java.lang.String charset)Called when about to be called to process a set of files.voiddestroy()Cleans up the object.voidfinishProcessing()Called when all the files have been processed.voidinit()Initialise the instance.java.util.SortedSet<Violation>process(java.io.File file, FileText fileText)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
configure
-
Methods inherited from interface com.puppycrawl.tools.checkstyle.api.Contextualizable
contextualize
-
-
-
-
Method Detail
-
setMessageDispatcher
void setMessageDispatcher(MessageDispatcher dispatcher)
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 it job.
-
destroy
void destroy()
Cleans up the object.
-
beginProcessing
void beginProcessing(java.lang.String charset)
Called when about to be called to process a set of files.- Parameters:
charset- the character set used to read the files.
-
process
java.util.SortedSet<Violation> process(java.io.File file, FileText fileText) throws CheckstyleException
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.
-
-