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

java.lang.Object
  extended by ro.isdc.wro.model.resource.processor.impl.css.AbstractCssImportPreProcessor
      extended by ro.isdc.wro.model.resource.processor.impl.css.CssImportPreProcessor
All Implemented Interfaces:
ImportAware, ResourcePreProcessor
Direct Known Subclasses:
LessCssImportPreProcessor

@SupportedResourceType(value=CSS)
public class CssImportPreProcessor
extends AbstractCssImportPreProcessor

CssImport Processor responsible for handling css @import statement. It is implemented as both: preProcessor & postProcessor. It is necessary because preProcessor is responsible for updating model with found imported resources, while post processor removes import occurrences.

When processor finds an import which is not valid, it will check the WroConfiguration.isIgnoreMissingResources() flag. If it is set to false, the processor will fail.

Author:
Alex Objelean

Field Summary
static String ALIAS
           
 
Constructor Summary
CssImportPreProcessor()
           
 
Method Summary
protected  String doTransform(String cssContent, List<Resource> foundImports)
          Perform actual transformation of provided cssContent and the list of found import resources.
protected  String removeImportStatements(String cssContent)
           
 
Methods inherited from class ro.isdc.wro.model.resource.processor.impl.css.AbstractCssImportPreProcessor
findImports, isImportAware, onImportDetected, onRecursiveImportDetected, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS

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

CssImportPreProcessor

public CssImportPreProcessor()
Method Detail

doTransform

protected String doTransform(String cssContent,
                             List<Resource> foundImports)
                      throws IOException
Perform actual transformation of provided cssContent and the list of found import resources.

Specified by:
doTransform in class AbstractCssImportPreProcessor
Parameters:
cssContent - the css to transform.
foundImports - the list of found imports.
Throws:
IOException

removeImportStatements

protected String removeImportStatements(String cssContent)
Returns:
the css content with all css import statements removed.


Copyright © 2008-2013. All Rights Reserved.