java.lang.Object
org.apache.wicket.resource.CssUrlReplacer
- All Implemented Interfaces:
ICssCompressor
,IScopeAwareTextResourceProcessor
,ITextResourceCompressor
public class CssUrlReplacer
extends Object
implements IScopeAwareTextResourceProcessor, ICssCompressor
This compressor is used to replace URLs within CSS files with URLs created from
PackageResourceReferences that belongs to their corresponding resources (e.g images).The scope of
the CSS file is used to create the PackageResourceReferences. The compress method is not
compressing any content, but replacing the URLs with Wicket representatives.
Usage:
Usage:
this.getResourceSettings().setCssCompressor(new CssUrlReplacer());
- Since:
- 6.20.0
- Author:
- Tobias Soloschenko
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Used to be append to CSS URLs (background-image: url('Beer.gif? -
Constructor Summary
ConstructorDescriptionCreates a css url replacerCssUrlReplacer
(Collection<String> excludes) Creates a css url replacer -
Method Summary
Modifier and TypeMethodDescriptionRemove comments and white spaces from the text resourceGets excluded css file namesReplaces the URLs of CSS resources with Wicket representatives.void
setExcludes
(Collection<String> excludes) Sets a list of css file names to be excluded
-
Field Details
-
EMBED_BASE64
Used to be append to CSS URLs (background-image: url('Beer.gif?embedBase64');). The CssUrlReplacer embeds the base64 content instead of using an URL.- See Also:
-
-
Constructor Details
-
CssUrlReplacer
public CssUrlReplacer()Creates a css url replacer -
CssUrlReplacer
Creates a css url replacer- Parameters:
excludes
- css file names to be excluded
-
-
Method Details
-
process
Replaces the URLs of CSS resources with Wicket representatives.- 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
-
getExcludes
Gets excluded css file names- Returns:
- a list with css file names to be excluded
-
setExcludes
Sets a list of css file names to be excluded- Parameters:
excludes
- a list with css file names to be excluded
-