Class AbstractLinter
java.lang.Object
ro.isdc.wro.extensions.processor.support.linter.AbstractLinter
Encapsulates common code for utilities like jsHint or jsLint.
- Since:
- 1.4.2
- Author:
- Alex Objelean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringprotected abstract Stringprotected abstract InputStreamprotected final WebjarUriLocatorsetOptions(String... options) voidValidates a js using jsHint and throwsLinterExceptionif the js is invalid.
-
Constructor Details
-
AbstractLinter
public AbstractLinter()
-
-
Method Details
-
getWebjarLocator
- Returns:
WebjarUriLocatorinstance to retrieve webjars.
-
getScriptAsStream
- Returns:
- the stream of the linter script. Override this method to provide a different script version.
- Throws:
IOException- if the stream is invalid or unavailable.
-
validate
Validates a js using jsHint and throwsLinterExceptionif the js is invalid. If no exception is thrown, the js is valid.- Parameters:
data- js content to process.- Throws:
LinterException
-
getLinterName
- Returns:
- the name of the function used to perform the lint operation.
-
setOptions
- Parameters:
options- the options to set
-
createDefaultOptions
- Returns:
- default options to use for linting.
-