Interface FileSetCheck

    • 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​(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

        SortedSet<Violationprocess​(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 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

        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.