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 several
Usage:
ICssCompressor
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
ConstructorDescriptionCompositeCssCompressor
(ICssCompressor... compressors) Initializes the composite CSS compressor with the givenICssCompressor
(s) -
Method Summary
Modifier and TypeMethodDescriptionadd
(ICssCompressor compressor) Adds a ICssCompressor to the list of delegates.Remove comments and white spaces from the text resourceCompresses the given original content in the order of compressors.
-
Constructor Details
-
CompositeCssCompressor
Initializes the composite CSS compressor with the givenICssCompressor
(s)- Parameters:
compressors
- TheICssCompressor
(s) this composite CSS compressor is initialized with
-
-
Method Details
-
process
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
Description copied from interface:ITextResourceCompressor
Remove comments and white spaces from the text resource- Specified by:
compress
in interfaceITextResourceCompressor
- Returns:
- compressed text resource
-
add
Adds a ICssCompressor to the list of delegates.- Returns:
this
instance, for chaining
-