Search in sources :

Example 1 with SeverityLevelCounter

use of com.puppycrawl.tools.checkstyle.api.SeverityLevelCounter in project checkstyle by checkstyle.

the class CheckstyleAntTask method realExecute.

/**
     * Helper implementation to perform execution.
     * @param checkstyleVersion Checkstyle compile version.
     */
private void realExecute(String checkstyleVersion) {
    // Create the root module
    RootModule rootModule = null;
    try {
        rootModule = createRootModule();
        // setup the listeners
        final AuditListener[] listeners = getListeners();
        for (AuditListener element : listeners) {
            rootModule.addListener(element);
        }
        final SeverityLevelCounter warningCounter = new SeverityLevelCounter(SeverityLevel.WARNING);
        rootModule.addListener(warningCounter);
        processFiles(rootModule, warningCounter, checkstyleVersion);
    } finally {
        destroyRootModule(rootModule);
    }
}
Also used : SeverityLevelCounter(com.puppycrawl.tools.checkstyle.api.SeverityLevelCounter) RootModule(com.puppycrawl.tools.checkstyle.api.RootModule) AuditListener(com.puppycrawl.tools.checkstyle.api.AuditListener)

Aggregations

AuditListener (com.puppycrawl.tools.checkstyle.api.AuditListener)1 RootModule (com.puppycrawl.tools.checkstyle.api.RootModule)1 SeverityLevelCounter (com.puppycrawl.tools.checkstyle.api.SeverityLevelCounter)1