Method Summary |
|
public static String | compress(String text, int level) Compress the source code by removing java style comments and removing
leading and trailing spaces.
Parameters: text - The javascript (or java) program to compress Parameters: level - The compression level - see LEVEL_* and COMPRESS_* constants. |
public String | compressJavaScript(String script) |
public void | setCompressionLevel(int compressionLevel) |
public static String | shrinkVariableNames(String text) Shrink variable names to a minimum.
Parameters: text - The javascript program to shrink the variable names in. |
public static String | stripBlankLines(String text) Remove all blank lines from a string. |
public static String | stripMultiLineComments(String text) |
public static String | stripNewlines(String text) Remove all newline characters from a string. |
public static String | stripSingleLineComments(String text) |
public static String | trimLines(String text) Remove any leading or trailing spaces from a line of code.
This function could be improved by making it strip unnecessary double
spaces, but since we would need to leave double spaces inside strings
this is not simple and since the benefit is small, we'll leave it for now
Parameters: text - The javascript program to strip spaces from. |