org.directwebremoting.impl
Class ShrinkSafeCompressor

java.lang.Object
  extended by org.directwebremoting.impl.ShrinkSafeCompressor
All Implemented Interfaces:
Compressor

public class ShrinkSafeCompressor
extends java.lang.Object
implements Compressor

JavaScript Compression Implementation using Dojo ShrinkSafe.

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
ShrinkSafeCompressor()
           
 
Method Summary
 java.lang.String compressJavaScript(java.lang.String source)
          Compress a JavaScript file to a smaller version of the original
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShrinkSafeCompressor

public ShrinkSafeCompressor()
                     throws java.lang.Exception
Throws:
java.lang.Exception - Likely if YUI is present, and not ShrinkSafe
Method Detail

compressJavaScript

public java.lang.String compressJavaScript(java.lang.String source)
                                    throws java.lang.Exception
Description copied from interface: Compressor
Compress a JavaScript file to a smaller version of the original

Specified by:
compressJavaScript in interface Compressor
Parameters:
source - The script to compress
Returns:
The compressed script
Throws:
java.lang.Exception - The implementations of this interface are all likely to have different things they can throw. We are going to catch Exception anyway because we can continue (by using uncompressed scripts) so why force implementors to nest to another exception type when we can just let them use the original exception?

Copyright 2008