com.github.wuic.engine.yuicompressor
Class YuiCompressorJavascriptEngine

java.lang.Object
  extended by com.github.wuic.engine.Engine
      extended by com.github.wuic.engine.NodeEngine
          extended by com.github.wuic.engine.core.AbstractCompressorEngine
              extended by com.github.wuic.engine.yuicompressor.YuiCompressorJavascriptEngine
All Implemented Interfaces:
com.github.wuic.util.Pipe.Transformer<com.github.wuic.nut.ConvertibleNut>, Comparable<com.github.wuic.engine.Engine>

@EngineService(injectDefaultToWorkflow=true)
public class YuiCompressorJavascriptEngine
extends com.github.wuic.engine.core.AbstractCompressorEngine

This class can compress Javascript files using the YUI compressor library.

Since:
0.1.0
Version:
1.8
Author:
Guillaume DROUET

Constructor Summary
YuiCompressorJavascriptEngine(Boolean compress, String cs, Integer lbp, Boolean disableOptim, Boolean verb, Boolean keepSemiColons, Boolean obfuscate)
           Creates a new instance.
 
Method Summary
 com.github.wuic.engine.EngineType getEngineType()
          
 List<com.github.wuic.NutType> getNutTypes()
          
 void transform(InputStream source, OutputStream target, com.github.wuic.nut.ConvertibleNut convertibleNut)
          
 
Methods inherited from class com.github.wuic.engine.core.AbstractCompressorEngine
canAggregateTransformedStream, internalParse, works
 
Methods inherited from class com.github.wuic.engine.NodeEngine
chain, getNext, getPrevious, parse, setNext
 
Methods inherited from class com.github.wuic.engine.Engine
compareTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YuiCompressorJavascriptEngine

@ConfigConstructor
public YuiCompressorJavascriptEngine(@BooleanConfigParam(propertyKey="c.g.wuic.engine.compress",defaultValue=true)
                                                       Boolean compress,
                                                       @StringConfigParam(propertyKey="c.g.wuic.engine.charset",defaultValue="UTF-8")
                                                       String cs,
                                                       @IntegerConfigParam(propertyKey="c.g.wuic.engine.lineBreakPos",defaultValue=-1)
                                                       Integer lbp,
                                                       @BooleanConfigParam(propertyKey="c.g.wuic.engine.disableOptimizations",defaultValue=true)
                                                       Boolean disableOptim,
                                                       @BooleanConfigParam(propertyKey="c.g.wuic.engine.verbose",defaultValue=false)
                                                       Boolean verb,
                                                       @BooleanConfigParam(propertyKey="c.g.wuic.engine.preserveSemiColons",defaultValue=true)
                                                       Boolean keepSemiColons,
                                                       @BooleanConfigParam(propertyKey="c.g.wuic.engine.obfuscate",defaultValue=true)
                                                       Boolean obfuscate)

Creates a new instance.

Parameters:
compress - activate compression or not
cs - charset of files to compress
lbp - line break position
disableOptim - disable micro optimizations
verb - be verbose when compressing
keepSemiColons - keep unnecessary semicolons
obfuscate - obfuscate the code or not
Method Detail

transform

public void transform(InputStream source,
                      OutputStream target,
                      com.github.wuic.nut.ConvertibleNut convertibleNut)
               throws IOException

Throws:
IOException

getNutTypes

public List<com.github.wuic.NutType> getNutTypes()

Specified by:
getNutTypes in class com.github.wuic.engine.NodeEngine

getEngineType

public com.github.wuic.engine.EngineType getEngineType()

Specified by:
getEngineType in class com.github.wuic.engine.Engine


Copyright © 2012-2014. All Rights Reserved.