Package org.apache.wicket.resource
Class CompositeCssCompressor
- java.lang.Object
-
- org.apache.wicket.resource.CompositeCssCompressor
-
- All Implemented Interfaces:
ICssCompressor
,IScopeAwareTextResourceProcessor
,ITextResourceCompressor
public class CompositeCssCompressor extends Object implements IScopeAwareTextResourceProcessor, ICssCompressor
Used to apply severalICssCompressor
to the CSS compression.
Usage:CompositeCssCompressor compositeCssCompressor = new CompositeCssCompressor(); compositeCssCompressor.add(new MyCssCompressor()); compositeCssCompressor.add(new AnotherCssCompressor()); this.getResourceSettings().setCssCompressor(compositeCssCompressor);
The compressors can also be given as constructor arguments.- Since:
- 6.20.0
- Author:
- Tobias Soloschenko
-
-
Constructor Summary
Constructors Constructor Description CompositeCssCompressor(ICssCompressor... compressors)
Initializes the composite CSS compressor with the givenICssCompressor
(s)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompositeCssCompressor
add(ICssCompressor compressor)
Adds a ICssCompressor to the list of delegates.String
compress(String original)
Remove comments and white spaces from the text resourceString
process(String input, Class<?> scope, String name)
Compresses the given original content in the order of compressors.
-
-
-
Constructor Detail
-
CompositeCssCompressor
public CompositeCssCompressor(ICssCompressor... compressors)
Initializes the composite CSS compressor with the givenICssCompressor
(s)- Parameters:
compressors
- TheICssCompressor
(s) this composite CSS compressor is initialized with
-
-
Method Detail
-
process
public String process(String input, Class<?> scope, String name)
Compresses the given original content in the order of compressors. If no compressor has been given the original content is going to be returned.- Specified by:
process
in interfaceIScopeAwareTextResourceProcessor
- Parameters:
input
- The original input to processscope
- The scope class of the package resourcename
- The name of the package resource- Returns:
- The processed input
-
compress
public String compress(String original)
Description copied from interface:ITextResourceCompressor
Remove comments and white spaces from the text resource- Specified by:
compress
in interfaceITextResourceCompressor
- Returns:
- compressed text resource
-
add
public CompositeCssCompressor add(ICssCompressor compressor)
Adds a ICssCompressor to the list of delegates.- Returns:
this
instance, for chaining
-
-