public class ClosureJsCompiler extends Object implements JsCompiler
| Constructor and Description |
|---|
ClosureJsCompiler(DefaultJsCompiler defaultCompiler,
CacheProvider cacheProvider,
String level) |
ClosureJsCompiler(DefaultJsCompiler defaultCompiler,
CacheProvider cacheProvider,
String level,
ExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
protected List<com.google.javascript.jscomp.SourceFile> |
buildExterns(String externs) |
JsResponse |
compile(JsUriManager.JsUri jsUri,
Iterable<JsContent> content,
String externs)
Compiles the provided code with the provided list of external symbols.
|
protected ExecutorService |
createThreadPool()
Override this to provide your own
ExecutorService |
com.google.javascript.jscomp.CompilerOptions |
defaultCompilerOptions() |
protected CompileResult |
doCompileContent(JsContent content,
com.google.javascript.jscomp.CompilerOptions options,
List<com.google.javascript.jscomp.SourceFile> externs) |
protected Future<CompileResult> |
getCompileFuture(String cacheKey,
JsContent content,
JsUriManager.JsUri jsUri,
String externs) |
protected com.google.javascript.jscomp.CompilerOptions |
getCompilerOptions(JsUriManager.JsUri uri) |
Iterable<JsContent> |
getJsContent(JsUriManager.JsUri jsUri,
FeatureRegistry.FeatureBundle bundle)
Pre-process feature JS.
|
protected String |
makeCacheKey(String code,
String externs,
JsUriManager.JsUri uri,
com.google.javascript.jscomp.CompilerOptions options) |
void |
setCompilerStackSize(Long compilerStackSize) |
void |
setThreadPoolSize(Integer threadPoolSize) |
@Inject public ClosureJsCompiler(DefaultJsCompiler defaultCompiler, CacheProvider cacheProvider, String level)
public ClosureJsCompiler(DefaultJsCompiler defaultCompiler, CacheProvider cacheProvider, String level, ExecutorService executorService)
@Inject(optional=true) public void setThreadPoolSize(Integer threadPoolSize)
@Inject(optional=true) public void setCompilerStackSize(Long compilerStackSize)
protected ExecutorService createThreadPool()
ExecutorServiceExecutorService to use for the compiler pool.public com.google.javascript.jscomp.CompilerOptions defaultCompilerOptions()
protected com.google.javascript.jscomp.CompilerOptions getCompilerOptions(JsUriManager.JsUri uri)
public JsResponse compile(JsUriManager.JsUri jsUri, Iterable<JsContent> content, String externs)
JsCompilercompile in interface JsCompilerjsUri - The JS uri making the request.content - The raw/pre-processed JS code.externs - The externs.protected Future<CompileResult> getCompileFuture(String cacheKey, JsContent content, JsUriManager.JsUri jsUri, String externs)
protected CompileResult doCompileContent(JsContent content, com.google.javascript.jscomp.CompilerOptions options, List<com.google.javascript.jscomp.SourceFile> externs) throws org.apache.shindig.gadgets.rewrite.js.ClosureJsCompiler.CompilerException
org.apache.shindig.gadgets.rewrite.js.ClosureJsCompiler.CompilerExceptionpublic Iterable<JsContent> getJsContent(JsUriManager.JsUri jsUri, FeatureRegistry.FeatureBundle bundle)
JsCompilergetJsContent in interface JsCompilerjsUri - The JS uri making the request.bundle - The feature bundle.protected String makeCacheKey(String code, String externs, JsUriManager.JsUri uri, com.google.javascript.jscomp.CompilerOptions options)
Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.