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 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

      void beginProcessing(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

      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 processed
      fileText - the contents of the file.
      Returns:
      the sorted set of violations to be logged.
      Throws:
      CheckstyleException - if error condition within Checkstyle occurs
    • 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.