Class NodeCoffeeScriptProcessor
java.lang.Object
ro.isdc.wro.extensions.processor.js.NodeCoffeeScriptProcessor
- All Implemented Interfaces:
ResourcePostProcessor,ResourcePreProcessor,SupportAware
- Direct Known Subclasses:
NodeLiterateCoffeeScriptProcessor
@SupportedResourceType(JS)
public class NodeCoffeeScriptProcessor
extends Object
implements ResourcePreProcessor, ResourcePostProcessor, SupportAware
Important node: this processor is not cross platform and has some pre-requesites in order to work.
Installation instructions:
npm install -g coffee-scriptIt is possible to test whether the lessc utility is available using
isSupported()- Since:
- 1.5.0
- Author:
- Alex Objelean
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]protected String[]getCommandLine(String filePath) Creates the platform specific arguments to run thelesscshell utility.booleanprotected voidonException(Exception e, String content) Invoked when a processing exception occurs.voidvoid
-
Field Details
-
ALIAS
- See Also:
-
-
Constructor Details
-
NodeCoffeeScriptProcessor
public NodeCoffeeScriptProcessor()
-
-
Method Details
-
process
- Specified by:
processin interfaceResourcePreProcessor- Throws:
IOException
-
onException
Invoked when a processing exception occurs. Default implementation wraps the original exception intoWroRuntimeException.- Parameters:
e- theExceptionthrown during processingcontent- the resource content being processed.
-
process
- Specified by:
processin interfaceResourcePostProcessor- Throws:
IOException
-
isSupported
public boolean isSupported()- Specified by:
isSupportedin interfaceSupportAware- Returns:
- true if the processor is supported on this environment. The implementation check if the required shell utility is available.
-
getCommandLine
Creates the platform specific arguments to run thelesscshell utility. Default implementation handles windows and unix platforms.- Returns:
- arguments for command line. The implementation will take care of OS differences.
-
buildOptionalArguments
- Returns:
- an array of optional arguments.
-