ro.isdc.wro.model.resource.processor.support
Class CssUrlInspector

java.lang.Object
  extended by ro.isdc.wro.model.resource.processor.support.CssUrlInspector
Direct Known Subclasses:
FallbackCssDataUriUrlInspector

public class CssUrlInspector
extends Object

Encapsulates the matcher creation for css backround url's detection. Useful to isolate unit tests.

Since:
1.6.3
Author:
Alex Objelean

Nested Class Summary
static interface CssUrlInspector.ItemHandler
          The handler invoked for each found occurrence of url in parsed css.
 
Constructor Summary
CssUrlInspector()
           
 
Method Summary
 String findAndReplace(String content, CssUrlInspector.ItemHandler handler)
           
protected  Matcher getMatcher(String content)
           
protected  String getOriginalDeclaration(Matcher matcher)
           
protected  String getOriginalUrl(Matcher matcher)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CssUrlInspector

public CssUrlInspector()
Method Detail

findAndReplace

public final String findAndReplace(String content,
                                   CssUrlInspector.ItemHandler handler)

getMatcher

protected Matcher getMatcher(String content)
Returns:
the Matcher for processed css content.

getOriginalDeclaration

protected String getOriginalDeclaration(Matcher matcher)
Parameters:
matcher - the Matcher used to find url occurances.
Returns:
the string representing entire css declaration containing the url.

getOriginalUrl

protected String getOriginalUrl(Matcher matcher)
Parameters:
matcher - the Matcher used to find url occurances.
Returns:
the url found in css declaration.


Copyright © 2008-2013. All Rights Reserved.