ro.isdc.wro.model.resource.processor.impl.css
Class DuplicatesAwareCssDataUriPreProcessor

java.lang.Object
  extended by ro.isdc.wro.model.resource.processor.impl.css.AbstractCssUrlRewritingProcessor
      extended by ro.isdc.wro.model.resource.processor.impl.css.CssDataUriPreProcessor
          extended by ro.isdc.wro.model.resource.processor.impl.css.DuplicatesAwareCssDataUriPreProcessor
All Implemented Interfaces:
ImportAware, ResourcePostProcessor, ResourcePreProcessor

public class DuplicatesAwareCssDataUriPreProcessor
extends CssDataUriPreProcessor

Similar to CssDataUriPreProcessor which instead of replacing a url blindly with dataUri, is is smart enough to detect duplicated image url and avoid replacing it with dataUri.

Author:
Alex Objelean

Field Summary
static String ALIAS_DUPLICATE
           
 
Fields inherited from class ro.isdc.wro.model.resource.processor.impl.css.CssDataUriPreProcessor
ALIAS
 
Constructor Summary
DuplicatesAwareCssDataUriPreProcessor()
           
 
Method Summary
protected  void onProcessCompleted()
          Invoked when the process operation is completed.
protected  String replaceImageUrl(String cssUri, String imageUrl)
          Replace provided url with the new url if needed.
 
Methods inherited from class ro.isdc.wro.model.resource.processor.impl.css.CssDataUriPreProcessor
getDataUriGenerator, isReplaceAccepted, isReplaceNeeded, replaceWithDataUri
 
Methods inherited from class ro.isdc.wro.model.resource.processor.impl.css.AbstractCssUrlRewritingProcessor
cleanImageUrl, getUrlPrefix, isImportAware, newCssUrlInspector, onUrlReplaced, process, process, replaceDeclaration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS_DUPLICATE

public static final String ALIAS_DUPLICATE
See Also:
Constant Field Values
Constructor Detail

DuplicatesAwareCssDataUriPreProcessor

public DuplicatesAwareCssDataUriPreProcessor()
Method Detail

replaceImageUrl

protected final String replaceImageUrl(String cssUri,
                                       String imageUrl)
Replace provided url with the new url if needed.

Overrides:
replaceImageUrl in class CssDataUriPreProcessor
Parameters:
imageUrl - to replace.
cssUri - Uri of the parsed css.
Returns:
replaced url.

onProcessCompleted

protected void onProcessCompleted()
Invoked when the process operation is completed. Useful to invoke some post processing logic or for custom logging.

Overrides:
onProcessCompleted in class AbstractCssUrlRewritingProcessor


Copyright © 2008-2013. All Rights Reserved.