public class CompositeJavaScriptCompressor extends Object implements IScopeAwareTextResourceProcessor, IJavaScriptCompressor
IJavaScriptCompressor
to the javascript compression.CompositeJavaScriptCompressor compositeJavaScriptCompressor = new CompositeJavaScriptCompressor(); compositeJavaScriptCompressor.add(new MyJavaScriptCompressor()); compositeJavaScriptCompressor.add(new AnotherJavaScriptCompressor()); this.getResourceSettings().setJavaScriptCompressor(compositeJavaScriptCompressor);The compressors can also be given as constructor arguments.
Constructor and Description |
---|
CompositeJavaScriptCompressor(IJavaScriptCompressor... compressors)
Initializes the composite javascript compressor with the given
IJavaScriptCompressor (s) |
Modifier and Type | Method and Description |
---|---|
CompositeJavaScriptCompressor |
add(IJavaScriptCompressor compressor)
Adds a IJavaScriptCompressor to the list of delegates.
|
String |
compress(String original)
Remove comments and white spaces from the text resource
|
String |
process(String input,
Class<?> scope,
String name)
Compresses the given original content in the order of compressors.
|
public CompositeJavaScriptCompressor(IJavaScriptCompressor... compressors)
IJavaScriptCompressor
(s)compressors
- The IJavaScriptCompressor
(s) this composite javascript compressor is
initialized withpublic String process(String input, Class<?> scope, String name)
process
in interface IScopeAwareTextResourceProcessor
input
- The original input to processscope
- The scope class of the package resourcename
- The name of the package resourcepublic String compress(String original)
ITextResourceCompressor
compress
in interface ITextResourceCompressor
public CompositeJavaScriptCompressor add(IJavaScriptCompressor compressor)
this
instance, for chainingCopyright © 2006–2021 Apache Software Foundation. All rights reserved.