|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.common.web.compressor.YUIJavaScriptCompressor
public class YUIJavaScriptCompressor
Constructor Summary | |
---|---|
YUIJavaScriptCompressor()
|
Method Summary | |
---|---|
void |
compress(Reader in,
Writer out)
Reads JavaScript from the the given Reader and writes the compressed code to the specified Writer. |
void |
compress(Reader in,
Writer out,
org.mozilla.javascript.ErrorReporter errorReporter)
Reads JavaScript from the the given Reader and writes the compressed code to the specified Writer. |
void |
compress(Reader in,
Writer out,
String fileName)
Reads JavaScript from the the given Reader and writes the compressed code to the specified Writer. |
protected void |
compressInternal(Reader in,
Writer out,
org.mozilla.javascript.ErrorReporter errorReporter)
Reads JavaScript from the the given Reader and writes the compressed code to the specified Writer. |
void |
setDefaultErrorReporter(org.mozilla.javascript.ErrorReporter defaultErrorReporter)
Sets the ErrorReporter used by compress(Reader, Writer) . |
void |
setEnabled(boolean enabled)
Enables the Compressor. |
void |
setFailsafe(boolean failsafe)
Sets whether the uncompressed script should be served in case a syntax error is encountered. |
void |
setLinebreak(int linebreak)
Sets the column number after which a line break should be inserted. |
void |
setMergeStringLiterals(boolean mergeStringLiterals)
Sets whether concatenated string literals should be merged. |
void |
setMunge(boolean munge)
Sets whether the code should be obfuscated. |
void |
setPreserveAllSemiColons(boolean preserveAllSemiColons)
Sets whether a semicolons should be preserved. |
void |
setWarn(boolean warn)
Sets whether possible errors in the code should be displayed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public YUIJavaScriptCompressor()
Method Detail |
---|
public void setEnabled(boolean enabled)
enabled
- true to enabled, false to disable this compressorpublic void setLinebreak(int linebreak)
-1
, which means that no breaks will be added.
public void setMunge(boolean munge)
false
the script will only be minified. Default is true
.
public void setWarn(boolean warn)
false
.
public void setPreserveAllSemiColons(boolean preserveAllSemiColons)
false
.
public void setMergeStringLiterals(boolean mergeStringLiterals)
true
.
public void setDefaultErrorReporter(org.mozilla.javascript.ErrorReporter defaultErrorReporter)
ErrorReporter
used by compress(Reader, Writer)
.
public void setFailsafe(boolean failsafe)
false
.
public void compress(Reader in, Writer out) throws IOException
default ErrorReorter
.
compress
in interface Compressor
IOException
public void compress(Reader in, Writer out, String fileName) throws IOException
IOException
public void compress(Reader in, Writer out, org.mozilla.javascript.ErrorReporter errorReporter) throws IOException
failsafe mode
the script
is first read into a buffer so that it can be written as-is in case
of an error. The actual compression is performed in
compressInternal(Reader, Writer, ErrorReporter)
.
IOException
protected void compressInternal(Reader in, Writer out, org.mozilla.javascript.ErrorReporter errorReporter) throws org.mozilla.javascript.EvaluatorException, IOException
org.mozilla.javascript.EvaluatorException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |