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

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

public class CssImportInspector
extends Object

Encapsulates the matcher creation for css import statements detection. Useful to isolate unit tests. TODO prefer a fluent interface implementation for this class.

Since:
1.6.3
Author:
Alex Objelean

Constructor Summary
CssImportInspector(String cssContent)
           
 
Method Summary
 boolean containsImport()
           
protected  String extractImportUrl(Matcher matcher)
          Override this method to provide a custom way of extracting the imported resource url.
 List<String> findImports()
           
protected  Matcher getMatcher(String cssContent)
           
 String removeImportStatements()
          Removes all @import statements from css.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CssImportInspector

public CssImportInspector(String cssContent)
Method Detail

getMatcher

protected Matcher getMatcher(String cssContent)
Returns:
a Matcher for the processed content using the regexp responsible for identifying css import statements.

removeImportStatements

public final String removeImportStatements()
Removes all @import statements from css.


containsImport

public final boolean containsImport()
Returns:
true if checked css content contains an @import statement.

findImports

public final List<String> findImports()
Returns:
a list of all resources imported using @import statement.

extractImportUrl

protected String extractImportUrl(Matcher matcher)
Override this method to provide a custom way of extracting the imported resource url.

Parameters:
matcher - the Matcher inspecting the parsed css content.
Returns:
the url of the imported resources.


Copyright © 2008-2013. All Rights Reserved.