Class AbstractLinterProcessor
java.lang.Object
ro.isdc.wro.extensions.processor.js.AbstractLinterProcessor
- All Implemented Interfaces:
Destroyable,ResourcePostProcessor,ResourcePreProcessor
- Direct Known Subclasses:
JsHintProcessor,JsLintProcessor
@SupportedResourceType(JS)
public abstract class AbstractLinterProcessor
extends Object
implements ResourcePreProcessor, ResourcePostProcessor, Destroyable
Processor which analyze the js code and warns you about any problems. The processing result won't change no matter
if the processed script contains errors or not.
- Since:
- 1.3.5
- Author:
- Alex Objelean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringvoiddestroy()protected abstract AbstractLinterprotected voidInvoked when a processing exception occurs.protected voidonLinterException(LinterException e, Resource resource) Called whenLinterExceptionis thrown.voidvoidsetOptionsAsString(String options)
-
Constructor Details
-
AbstractLinterProcessor
public AbstractLinterProcessor()
-
-
Method Details
-
process
- Specified by:
processin interfaceResourcePreProcessor- Throws:
IOException
-
onException
Invoked when a processing exception occurs. -
process
- Specified by:
processin interfaceResourcePostProcessor- Throws:
IOException
-
onLinterException
Called whenLinterExceptionis thrown. Allows subclasses to re-throw this exception as aRuntimeExceptionor handle it differently. The default implementation simply logs the errors.- Parameters:
e-LinterExceptionwhich has occurred.resource- the processed resource which caused the exception.
-
createDefaultOptions
- Returns:
- default options to use for linting.
-
setOptionsAsString
- Parameters:
options- comma separated list of options.
-
newLinter
- Returns:
- the linter to use for js code validation.
-
destroy
- Specified by:
destroyin interfaceDestroyable- Throws:
Exception
-