org.bbqjs.compiler.javascript
Class JavaScriptCompiler
java.lang.Object
org.bbqjs.compiler.AbstractCompiler<CompilableJavaScriptFile>
org.bbqjs.compiler.javascript.JavaScriptCompiler
- All Implemented Interfaces:
- Compiler
public class JavaScriptCompiler
- extends AbstractCompiler<CompilableJavaScriptFile>
Method Summary |
protected void |
afterWrittenLibrariesToOutputStream(List<CompilableJavaScriptFile> includedFiles,
OutputStream outputStream)
Override this method to perform any post processing or cleanup. |
void |
compile(URL inputFile,
String packageName,
OutputStream outputStream,
String[] sourceRoots)
Writes the compiled form of the input file into the passed output stream. |
protected void |
createNamespace(String packageName,
Map<String,Map<String,Object>> nameSpace)
Builds a tree representing all the package names used by the source file and the files
it includes |
static void |
setLogger(org.slf4j.Logger log)
|
protected void |
writePackageNames(Map<String,Map<String,Object>> ns,
int indentation,
String assigner,
OutputStream outputStream)
Prints the package tree out into the passed output stream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaScriptCompiler
public JavaScriptCompiler(String[] libraries)
setLogger
public static void setLogger(org.slf4j.Logger log)
compile
public void compile(URL inputFile,
String packageName,
OutputStream outputStream,
String[] sourceRoots)
throws IOException
- Description copied from interface:
Compiler
- Writes the compiled form of the input file into the passed output stream.
- Throws:
IOException
afterWrittenLibrariesToOutputStream
protected void afterWrittenLibrariesToOutputStream(List<CompilableJavaScriptFile> includedFiles,
OutputStream outputStream)
throws IOException
- Description copied from class:
AbstractCompiler
- Override this method to perform any post processing or cleanup.
- Overrides:
afterWrittenLibrariesToOutputStream
in class AbstractCompiler<CompilableJavaScriptFile>
- Throws:
IOException
createNamespace
protected void createNamespace(String packageName,
Map<String,Map<String,Object>> nameSpace)
- Builds a tree representing all the package names used by the source file and the files
it includes
- Parameters:
packageName
- nameSpace
-
writePackageNames
protected void writePackageNames(Map<String,Map<String,Object>> ns,
int indentation,
String assigner,
OutputStream outputStream)
throws IOException
- Prints the package tree out into the passed output stream
- Parameters:
ns
- indentation
- assigner
- outputStream
-
- Throws:
IOException
Copyright © 2012. All Rights Reserved.