Coverage Report - com.puppycrawl.tools.checkstyle.api.FileSetCheck
 
Classes in this File Line Coverage Branch Coverage Complexity
FileSetCheck
N/A
N/A
1
 
 1  
 ////////////////////////////////////////////////////////////////////////////////
 2  
 // checkstyle: Checks Java source code for adherence to a set of rules.
 3  
 // Copyright (C) 2001-2014  Oliver Burn
 4  
 //
 5  
 // This library is free software; you can redistribute it and/or
 6  
 // modify it under the terms of the GNU Lesser General Public
 7  
 // License as published by the Free Software Foundation; either
 8  
 // version 2.1 of the License, or (at your option) any later version.
 9  
 //
 10  
 // This library is distributed in the hope that it will be useful,
 11  
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 13  
 // Lesser General Public License for more details.
 14  
 //
 15  
 // You should have received a copy of the GNU Lesser General Public
 16  
 // License along with this library; if not, write to the Free Software
 17  
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 18  
 ////////////////////////////////////////////////////////////////////////////////
 19  
 package com.puppycrawl.tools.checkstyle.api;
 20  
 
 21  
 import java.io.File;
 22  
 import java.util.List;
 23  
 import java.util.TreeSet;
 24  
 
 25  
 /**
 26  
  * Interface for Checking a set of files for some criteria.
 27  
  *
 28  
  * @author lkuehne
 29  
  * @author oliver
 30  
  */
 31  
 public interface FileSetCheck
 32  
     extends Configurable, Contextualizable
 33  
 {
 34  
     /**
 35  
      * Sets the MessageDispatcher that is used to dispatch error
 36  
      * messages to AuditListeners during processing.
 37  
      * @param aDispatcher the dispatcher
 38  
      */
 39  
     void setMessageDispatcher(MessageDispatcher aDispatcher);
 40  
 
 41  
     /**
 42  
      * Initialise the instance. This is the time to verify that everything
 43  
      * required to perform it job.
 44  
      */
 45  
     void init();
 46  
 
 47  
     /** Cleans up the object. **/
 48  
     void destroy();
 49  
 
 50  
     /**
 51  
      * Called when about to be called to process a set of files.
 52  
      * @param aCharset the character set used to read the files.
 53  
      */
 54  
     void beginProcessing(String aCharset);
 55  
 
 56  
     /**
 57  
      * Request to process a file. The implementation should use the supplied
 58  
      * contents and not read the contents again. This reduces the amount of
 59  
      * file I/O.
 60  
      * <p>
 61  
      * The file set to process might contain files that are not
 62  
      * interesting to the FileSetCheck. Such files should be ignored,
 63  
      * no error message should be fired for them. For example a FileSetCheck
 64  
      * that checks java files should ignore HTML or properties files.
 65  
      * <p>
 66  
      * The method should return the set of messages to be logged.
 67  
      *
 68  
      * @param aFile the file to be processed
 69  
      * @param aLines an immutable list of the contents of the file.
 70  
      * @return the list of messages to be logged.
 71  
      */
 72  
     TreeSet<LocalizedMessage> process(File aFile, List<String> aLines);
 73  
 
 74  
     /**
 75  
      * Called when all the files have been processed. This is the time to
 76  
      * perform any checks that need to be done across a set of files. In this
 77  
      * method, the implementation is responsible for the logging of messages.
 78  
      */
 79  
     void finishProcessing();
 80  
 }