Class GatewayCheckstyleListener

  • All Implemented Interfaces:
    com.puppycrawl.tools.checkstyle.api.AuditListener, java.util.EventListener

    public class GatewayCheckstyleListener
    extends java.lang.Object
    implements com.puppycrawl.tools.checkstyle.api.AuditListener
    This is a listener for checkstyle. It is designed to follow the rules of checkstyle for gateway java. We grade by only taking off once per type of error. Therefore rather than the default output, we group errors by type Listing every instance of a specific issue on a single line.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addError​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)  
      void addException​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt, java.lang.Throwable aThrowable)  
      void auditFinished​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)  
      void auditStarted​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)  
      void fileFinished​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)  
      void fileStarted​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)  
      static java.util.List<jh61b.grader.TestResult> getResults()
      A method to return all the tests run from an audit.
      static void setDefaultValues​(double max, double lossVal, java.lang.String visibil, boolean typeOrInst)
      Sets the values for the score and visibility of checkstyle tests.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GatewayCheckstyleListener

        public GatewayCheckstyleListener()
        The constructor of the listener.
    • Method Detail

      • setDefaultValues

        public static void setDefaultValues​(double max,
                                            double lossVal,
                                            java.lang.String visibil,
                                            boolean typeOrInst)
        Sets the values for the score and visibility of checkstyle tests.
        Parameters:
        max - the maximum score you can get for checkstyle
        lossVal - the number of points lost for every mistake
        visibil - the visibility of each test
        typeOrInst - whether to take off per type of error (True) or all mistakes (False)
      • getResults

        public static java.util.List<jh61b.grader.TestResult> getResults()
        A method to return all the tests run from an audit.
        Returns:
        the list of tests
      • auditStarted

        public void auditStarted​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)
        Specified by:
        auditStarted in interface com.puppycrawl.tools.checkstyle.api.AuditListener
      • auditFinished

        public void auditFinished​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)
        Specified by:
        auditFinished in interface com.puppycrawl.tools.checkstyle.api.AuditListener
      • fileStarted

        public void fileStarted​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)
        Specified by:
        fileStarted in interface com.puppycrawl.tools.checkstyle.api.AuditListener
      • fileFinished

        public void fileFinished​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)
        Specified by:
        fileFinished in interface com.puppycrawl.tools.checkstyle.api.AuditListener
      • addError

        public void addError​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt)
        Specified by:
        addError in interface com.puppycrawl.tools.checkstyle.api.AuditListener
      • addException

        public void addException​(com.puppycrawl.tools.checkstyle.api.AuditEvent aEvt,
                                 java.lang.Throwable aThrowable)
        Specified by:
        addException in interface com.puppycrawl.tools.checkstyle.api.AuditListener