Interface ScriptCompiler
-
@ConsumerType public interface ScriptCompiler
Compilerdefines a generic compiler.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcompile(Collection<ScriptResource> src, Writer dst, CompilerContext ctx)Compiles a given collection of resources.StringgetMimeType()Returns the mime type of the output file.StringgetName()Name of this compiler.StringgetOutputExtension()Returns the extension of the output filebooleanhandles(String extension)Checks if this compiler handles the file with the given extension
-
-
-
Method Detail
-
getName
String getName()
Name of this compiler.- Returns:
- the name
-
handles
boolean handles(String extension)
Checks if this compiler handles the file with the given extension- Parameters:
extension- extension, eg 'less'- Returns:
trueif this compiler handles the extension
-
getMimeType
String getMimeType()
Returns the mime type of the output file.- Returns:
- the mime type.
-
getOutputExtension
String getOutputExtension()
Returns the extension of the output file- Returns:
- the extension of the output file. eg. 'css'
-
compile
void compile(Collection<ScriptResource> src, Writer dst, CompilerContext ctx) throws IOException
Compiles a given collection of resources.- Parameters:
src- resource to compiledst- writer to write the compiled outputctx- the compiler context- Throws:
IOException- of an I/O error occurs
-
-