|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.impl.LegacyCompressor
public class LegacyCompressor
An implementation of Compressor that does nothing.
| Field Summary | |
|---|---|
static int |
COMPRESS_REMOVE_NEWLINES
Flag for use in javascript compression: Remove all lines endings. |
static int |
COMPRESS_SHRINK_VARS
Flag for use in javascript compression: Shrink variable names. |
static int |
COMPRESS_STRIP_BLANKLINES
Flag for use in javascript compression: Remove blank lines. |
static int |
COMPRESS_STRIP_ML_COMMENTS
Flag for use in javascript compression: Remove multi line comments. |
static int |
COMPRESS_STRIP_SL_COMMENTS
Flag for use in javascript compression: Remove single line comments. |
static int |
COMPRESS_TRIM_LINES
Flag for use in javascript compression: Remove whitespace at the start and end of a line. |
static int |
LEVEL_DEBUGGABLE
Basic compression that leaves the source fully debuggable. |
static int |
LEVEL_NONE
Compression level that leaves the source un-touched. |
static int |
LEVEL_NORMAL
Normal compression makes all changes that will work for generic javascript. |
static int |
LEVEL_ULTRA
LEVEL_ULTRA performs additional compression that makes some assumptions about the style of javascript. |
| Constructor Summary | |
|---|---|
LegacyCompressor()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
compress(java.lang.String text,
int level)
Compress the source code by removing java style comments and removing leading and trailing spaces. |
java.lang.String |
compressJavaScript(java.lang.String script)
Compress a JavaScript file to a smaller version of the original |
void |
setCompressionLevel(int compressionLevel)
|
static java.lang.String |
shrinkVariableNames(java.lang.String text)
Shrink variable names to a minimum. |
static java.lang.String |
stripBlankLines(java.lang.String text)
Remove all blank lines from a string. |
static java.lang.String |
stripMultiLineComments(java.lang.String text)
Remove all the multi-line comments from a block of text |
static java.lang.String |
stripNewlines(java.lang.String text)
Remove all newline characters from a string. |
static java.lang.String |
stripSingleLineComments(java.lang.String text)
Remove all the single-line comments from a block of text |
static java.lang.String |
trimLines(java.lang.String text)
Remove any leading or trailing spaces from a line of code. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int COMPRESS_STRIP_SL_COMMENTS
public static final int COMPRESS_STRIP_ML_COMMENTS
public static final int COMPRESS_TRIM_LINES
public static final int COMPRESS_STRIP_BLANKLINES
public static final int COMPRESS_SHRINK_VARS
public static final int COMPRESS_REMOVE_NEWLINES
public static final int LEVEL_NONE
public static final int LEVEL_DEBUGGABLE
public static final int LEVEL_NORMAL
public static final int LEVEL_ULTRA
| Constructor Detail |
|---|
public LegacyCompressor()
| Method Detail |
|---|
public java.lang.String compressJavaScript(java.lang.String script)
throws java.io.IOException
Compressor
compressJavaScript in interface Compressorscript - The script to compress
java.io.IOException
public static java.lang.String compress(java.lang.String text,
int level)
text - The javascript (or java) program to compresslevel - The compression level - see LEVEL_* and COMPRESS_* constants.
public static java.lang.String trimLines(java.lang.String text)
text - The javascript program to strip spaces from.
public static java.lang.String stripSingleLineComments(java.lang.String text)
text - The text to remove single-line comments from
public static java.lang.String stripMultiLineComments(java.lang.String text)
text - The text to remove multi-line comments from
public static java.lang.String stripBlankLines(java.lang.String text)
text - The string to strip blank lines from
public static java.lang.String stripNewlines(java.lang.String text)
text - The string to strip newline characters from
public static java.lang.String shrinkVariableNames(java.lang.String text)
text - The javascript program to shrink the variable names in.
public void setCompressionLevel(int compressionLevel)
compressionLevel - The compressionLevel to set.
|
Copyright ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||