Java Doc for LegacyCompressor.java in  » Ajax » dwr » org » directwebremoting » impl » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » dwr » org.directwebremoting.impl 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.directwebremoting.impl.LegacyCompressor

LegacyCompressor
public class LegacyCompressor implements Compressor(Code)
An implementation of Compressor that does nothing.
author:
   Joe Walker [joe at getahead dot ltd dot uk]


Field Summary
final public static  intCOMPRESS_REMOVE_NEWLINES
     Flag for use in javascript compression: Remove all lines endings. Warning: Javascript can add semi-colons in for you.
final public static  intCOMPRESS_SHRINK_VARS
     Flag for use in javascript compression: Shrink variable names.
final public static  intCOMPRESS_STRIP_BLANKLINES
     Flag for use in javascript compression: Remove blank lines.
final public static  intCOMPRESS_STRIP_ML_COMMENTS
     Flag for use in javascript compression: Remove multi line comments.
final public static  intCOMPRESS_STRIP_SL_COMMENTS
     Flag for use in javascript compression: Remove single line comments.
final public static  intCOMPRESS_TRIM_LINES
     Flag for use in javascript compression: Remove whitespace at the start and end of a line.
final public static  intLEVEL_DEBUGGABLE
     Basic compression that leaves the source fully debuggable.
final public static  intLEVEL_NONE
     Compression level that leaves the source un-touched.
final public static  intLEVEL_NORMAL
     Normal compression makes all changes that will work for generic javascript.
final public static  intLEVEL_ULTRA
     LEVEL_ULTRA performs additional compression that makes some assumptions about the style of javascript.
protected  intcompressionLevel
    


Method Summary
public static  Stringcompress(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  StringcompressJavaScript(String script)
    
public  voidsetCompressionLevel(int compressionLevel)
    
public static  StringshrinkVariableNames(String text)
     Shrink variable names to a minimum.
Parameters:
  text - The javascript program to shrink the variable names in.
public static  StringstripBlankLines(String text)
     Remove all blank lines from a string.
public static  StringstripMultiLineComments(String text)
    
public static  StringstripNewlines(String text)
     Remove all newline characters from a string.
public static  StringstripSingleLineComments(String text)
    
public static  StringtrimLines(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.

Field Detail
COMPRESS_REMOVE_NEWLINES
final public static int COMPRESS_REMOVE_NEWLINES(Code)
Flag for use in javascript compression: Remove all lines endings. Warning: Javascript can add semi-colons in for you. If you make use of this feature then removing newlines may well break. For ease of use you may wish to use one of the LEVEL_* compression levels.



COMPRESS_SHRINK_VARS
final public static int COMPRESS_SHRINK_VARS(Code)
Flag for use in javascript compression: Shrink variable names. This option is currently un-implemented. For ease of use you may wish to use one of the LEVEL_* compression levels.



COMPRESS_STRIP_BLANKLINES
final public static int COMPRESS_STRIP_BLANKLINES(Code)
Flag for use in javascript compression: Remove blank lines. This option will make the javascript harder to debug because line number references are likely be altered. For ease of use you may wish to use one of the LEVEL_* compression levels.



COMPRESS_STRIP_ML_COMMENTS
final public static int COMPRESS_STRIP_ML_COMMENTS(Code)
Flag for use in javascript compression: Remove multi line comments. For ease of use you may wish to use one of the LEVEL_* compression levels.



COMPRESS_STRIP_SL_COMMENTS
final public static int COMPRESS_STRIP_SL_COMMENTS(Code)
Flag for use in javascript compression: Remove single line comments. For ease of use you may wish to use one of the LEVEL_* compression levels.



COMPRESS_TRIM_LINES
final public static int COMPRESS_TRIM_LINES(Code)
Flag for use in javascript compression: Remove whitespace at the start and end of a line. For ease of use you may wish to use one of the LEVEL_* compression levels.



LEVEL_DEBUGGABLE
final public static int LEVEL_DEBUGGABLE(Code)
Basic compression that leaves the source fully debuggable. This includes removing all comments and extraneous whitespace.



LEVEL_NONE
final public static int LEVEL_NONE(Code)
Compression level that leaves the source un-touched.



LEVEL_NORMAL
final public static int LEVEL_NORMAL(Code)
Normal compression makes all changes that will work for generic javascript. This adds variable name compression and blank line removal in addition to the compressions done by LEVEL_DEBUGGABLE.



LEVEL_ULTRA
final public static int LEVEL_ULTRA(Code)
LEVEL_ULTRA performs additional compression that makes some assumptions about the style of javascript. Specifically it assumes that you are not using JavaScript's ability to infer where the ; should go.



compressionLevel
protected int compressionLevel(Code)
How much do we compression javascript by?





Method Detail
compress
public static String compress(String text, int level)(Code)
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. The compressed version



compressJavaScript
public String compressJavaScript(String script) throws IOException(Code)



setCompressionLevel
public void setCompressionLevel(int compressionLevel)(Code)

Parameters:
  compressionLevel - The compressionLevel to set.



shrinkVariableNames
public static String shrinkVariableNames(String text)(Code)
Shrink variable names to a minimum.
Parameters:
  text - The javascript program to shrink the variable names in. The shrunk version of the javascript program.



stripBlankLines
public static String stripBlankLines(String text)(Code)
Remove all blank lines from a string. A blank line is defined to be a line where the only characters are whitespace. We always ensure that the line contains a newline at the end.
Parameters:
  text - The string to strip blank lines from The blank line stripped reply



stripMultiLineComments
public static String stripMultiLineComments(String text)(Code)
Remove all the multi-line comments from a block of text
Parameters:
  text - The text to remove multi-line comments from The multi-line comment free text



stripNewlines
public static String stripNewlines(String text)(Code)
Remove all newline characters from a string.
Parameters:
  text - The string to strip newline characters from The stripped reply



stripSingleLineComments
public static String stripSingleLineComments(String text)(Code)
Remove all the single-line comments from a block of text
Parameters:
  text - The text to remove single-line comments from The single-line comment free text



trimLines
public static String trimLines(String text)(Code)
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. The stripped program



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.