Package ro.isdc.wro.maven.plugin
Class AbstractLinterMojo<T>
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- ro.isdc.wro.maven.plugin.AbstractWro4jMojo
-
- ro.isdc.wro.maven.plugin.AbstractSingleProcessorMojo
-
- ro.isdc.wro.maven.plugin.AbstractLinterMojo<T>
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CssLintMojo,JsHintMojo,JsLintMojo
public abstract class AbstractLinterMojo<T> extends AbstractSingleProcessorMojo
Contains common behavior for mojos responsible for static code analysis, example: csslint, jslint, jshint. Typeindicates the type of lint errors reported by this mojo. - Since:
- 1.6.3
- Author:
- Alex Objelean
-
-
Constructor Summary
Constructors Constructor Description AbstractLinterMojo()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddReport(ro.isdc.wro.extensions.support.lint.ResourceLintReport<T> report)Add a single report to the registry of found errors.protected abstract ro.isdc.wro.extensions.support.lint.ReportXmlFormattercreateXmlFormatter(ro.isdc.wro.extensions.support.lint.LintReport<T> lintReport, ro.isdc.wro.extensions.support.lint.ReportXmlFormatter.FormatterType type)protected ProgressIndicatorgetProgressIndicator()protected abstract java.io.FilegetReportFile()protected abstract java.lang.StringgetReportFormat()protected booleanisFailAllowed()booleanisFailNever()protected voidonAfterExecute()Invoked right after execution completion.protected voidonBeforeExecute()Invoked before execution is performed.protected voidonProcessingResource(ro.isdc.wro.model.resource.Resource resource)A method which should be invoked on each new resource processing, having as a side effect an increment of the counter holding the number of total processed resources.voidsetFailFast(boolean failFast)voidsetFailNever(boolean failNever)voidsetFailThreshold(int failThreshold)-
Methods inherited from class ro.isdc.wro.maven.plugin.AbstractSingleProcessorMojo
createResourceProcessor, doExecute, getOptions, newWroManagerFactory, wantProcessGroup
-
Methods inherited from class ro.isdc.wro.maven.plugin.AbstractWro4jMojo
execute, extendPluginClasspath, getManagerFactory, getTargetGroupsAsList, getTaskExecutor, isIncrementalBuild, isIncrementalCheckRequired, isParallelProcessing, validate
-
-
-
-
Method Detail
-
addReport
protected final void addReport(ro.isdc.wro.extensions.support.lint.ResourceLintReport<T> report)
Add a single report to the registry of found errors.- Parameters:
report- to add.
-
onBeforeExecute
protected void onBeforeExecute()
Description copied from class:AbstractWro4jMojoInvoked before execution is performed.- Overrides:
onBeforeExecutein classAbstractWro4jMojo
-
onAfterExecute
protected void onAfterExecute()
Description copied from class:AbstractWro4jMojoInvoked right after execution completion. This method is invoked also if the execution failed with an exception.- Overrides:
onAfterExecutein classAbstractWro4jMojo
-
createXmlFormatter
protected abstract ro.isdc.wro.extensions.support.lint.ReportXmlFormatter createXmlFormatter(ro.isdc.wro.extensions.support.lint.LintReport<T> lintReport, ro.isdc.wro.extensions.support.lint.ReportXmlFormatter.FormatterType type)
- Returns:
- an instance of
ReportXmlFormatterresponsible for generating lint report.
-
onProcessingResource
protected final void onProcessingResource(ro.isdc.wro.model.resource.Resource resource)
A method which should be invoked on each new resource processing, having as a side effect an increment of the counter holding the number of total processed resources.
-
isFailAllowed
protected final boolean isFailAllowed()
- Returns:
- true if the build can fail due to found errors based on existing configuration.
-
getReportFile
protected abstract java.io.File getReportFile()
- Returns:
- the file where the report should be written.
-
getReportFormat
protected abstract java.lang.String getReportFormat()
- Returns:
- the preferred format of the report.
-
getProgressIndicator
protected final ProgressIndicator getProgressIndicator()
-
setFailNever
public void setFailNever(boolean failNever)
- Overrides:
setFailNeverin classAbstractSingleProcessorMojo- Parameters:
failNever- the failFast to set.
-
setFailThreshold
public void setFailThreshold(int failThreshold)
-
isFailNever
public boolean isFailNever()
- Overrides:
isFailNeverin classAbstractSingleProcessorMojo- Returns:
- the failNever flag.
-
setFailFast
public void setFailFast(boolean failFast)
- Parameters:
failFast- flag to set.
-
-