fnug.resource
Class JsCompressor

java.lang.Object
  extended by fnug.resource.JsCompressor
All Implemented Interfaces:
Compressor

public class JsCompressor
extends Object
implements Compressor

Implementation of Compressor for javascript. Uses a wrapped Google Closure Compiler.

Author:
Martin Algesten

Constructor Summary
JsCompressor(String... args)
          Constructs potentially sending configuration options to the wrapped google closure compiler.
 
Method Summary
 byte[] compress(byte[] input)
          Compresses the given input of bytes.
 String name()
          Returns what type of compressor this is.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsCompressor

public JsCompressor(String... args)
Constructs potentially sending configuration options to the wrapped google closure compiler.

Parameters:
args - arguments to send.
Method Detail

name

public String name()
Returns what type of compressor this is. "javascript" or "css".

Specified by:
name in interface Compressor

compress

public byte[] compress(byte[] input)
Compresses the given input of bytes.

Specified by:
compress in interface Compressor
Parameters:
input - bytes to compress
Returns:
the compressed bytes.


Copyright © 2012. All Rights Reserved.