org.broadleafcommerce.common.resource.service
Class ResourceMinificationServiceImpl
java.lang.Object
org.broadleafcommerce.common.resource.service.ResourceMinificationServiceImpl
- All Implemented Interfaces:
- ResourceMinificationService
@Service(value="blResourceMinificationService")
public class ResourceMinificationServiceImpl
- extends Object
- implements ResourceMinificationService
- Author:
- Andre Azzolini (apazzolini)
- See Also:
ResourceMinificationService
|
Method Summary |
protected org.mozilla.javascript.ErrorReporter |
getLogBasedErrorReporter()
|
byte[] |
minify(String filename,
byte[] bytes)
Given the source byte[], will return a byte[] that represents the YUI-compressor minified version
of the byte[]. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
protected static final org.apache.commons.logging.Log LOG
enabled
@Value(value="${minify.enabled}")
protected boolean enabled
linebreak
@Value(value="${minify.linebreak}")
protected int linebreak
munge
@Value(value="${minify.munge}")
protected boolean munge
verbose
@Value(value="${minify.verbose}")
protected boolean verbose
preserveAllSemiColons
@Value(value="${minify.preserveAllSemiColons}")
protected boolean preserveAllSemiColons
disableOptimizations
@Value(value="${minify.disableOptimizations}")
protected boolean disableOptimizations
ResourceMinificationServiceImpl
public ResourceMinificationServiceImpl()
minify
public byte[] minify(String filename,
byte[] bytes)
- Description copied from interface:
ResourceMinificationService
- Given the source byte[], will return a byte[] that represents the YUI-compressor minified version
of the byte[]. The behavior of this method is controlled via the following properties:
- minify.enabled - whether or not to actually perform minification
- minify.linebreak - if set to a value other than -1, will enforce a linebreak at that value
- minify.munge - if true, will replace variable names with shorter versions
- minify.verbose - if true, will display extra logging information to the console
- minify.preserveAllSemiColons - if true, will never remove semi-colons, even if two in a row exist
- minify.disableOptimizations - if true, will disable some micro-optimizations that are performed
- Specified by:
minify in interface ResourceMinificationService
- Returns:
- the minified bytes
getLogBasedErrorReporter
protected org.mozilla.javascript.ErrorReporter getLogBasedErrorReporter()
Copyright © 2013. All Rights Reserved.