|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.extensions.processor.js.GoogleClosureCompressorProcessor
@Minimize @SupportedResourceType(value=JS) public class GoogleClosureCompressorProcessor
Uses Google closure compiler for js minimization.
In order to make this classContext agnostic, set the encoding explicitly using
setEncoding(String).
http://blog.bolinfest.com/2009/11/calling-closure-compiler-from-java.html| Field Summary | |
|---|---|
static String |
ALIAS_ADVANCED
|
static String |
ALIAS_SIMPLE
|
static String |
ALIAS_WHITESPACE_ONLY
|
| Constructor Summary | |
|---|---|
GoogleClosureCompressorProcessor()
Uses google closure compiler with default compilation level: CompilationLevel.SIMPLE_OPTIMIZATIONS |
|
GoogleClosureCompressorProcessor(com.google.javascript.jscomp.CompilationLevel compilationLevel)
Uses google closure compiler with specified compilation level. |
|
| Method Summary | |
|---|---|
protected com.google.javascript.jscomp.SourceFile[] |
getExterns(Resource resource)
|
protected com.google.javascript.jscomp.CompilerOptions |
newCompilerOptions()
|
protected void |
onException(Exception e)
Invoked when an exception occurs during processing. |
void |
process(Reader reader,
Writer writer)
|
void |
process(Resource resource,
Reader reader,
Writer writer)
|
GoogleClosureCompressorProcessor |
setCompilationLevel(com.google.javascript.jscomp.CompilationLevel compilationLevel)
|
GoogleClosureCompressorProcessor |
setCompilerOptions(com.google.javascript.jscomp.CompilerOptions compilerOptions)
|
GoogleClosureCompressorProcessor |
setEncoding(String encoding)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ALIAS_SIMPLE
public static final String ALIAS_ADVANCED
public static final String ALIAS_WHITESPACE_ONLY
| Constructor Detail |
|---|
public GoogleClosureCompressorProcessor()
CompilationLevel.SIMPLE_OPTIMIZATIONS
public GoogleClosureCompressorProcessor(com.google.javascript.jscomp.CompilationLevel compilationLevel)
compilationLevel - not null CompilationLevel enum.| Method Detail |
|---|
public void process(Resource resource,
Reader reader,
Writer writer)
throws IOException
process in interface ResourcePreProcessorIOExceptionprotected void onException(Exception e)
WroRuntimeException and throws it further.
e - Exception thrown during processing.public GoogleClosureCompressorProcessor setEncoding(String encoding)
encoding - the encoding to setprotected com.google.javascript.jscomp.SourceFile[] getExterns(Resource resource)
resource - Currently processed resource. The resource can be null, when the closure compiler is used as a post
processor.
public GoogleClosureCompressorProcessor setCompilerOptions(com.google.javascript.jscomp.CompilerOptions compilerOptions)
compilerOptions - the compilerOptions to setpublic GoogleClosureCompressorProcessor setCompilationLevel(com.google.javascript.jscomp.CompilationLevel compilationLevel)
compilationLevel - the compilationLevel to setprotected com.google.javascript.jscomp.CompilerOptions newCompilerOptions()
CompilerOptions object to be used by compressor.
public void process(Reader reader,
Writer writer)
throws IOException
process in interface ResourcePostProcessorIOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||