@SupportedResourceType(value=CSS) public abstract class AbstractCssImportPreProcessor extends Object implements ResourcePreProcessor, ImportAware
@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.| Constructor and Description |
|---|
AbstractCssImportPreProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract String |
doTransform(String cssContent,
List<Resource> importedResources)
Perform actual transformation of provided cssContent and the list of found import resources.
|
boolean |
isImportAware() |
protected void |
onImportDetected(String foundImportUri)
Invoked when an import is detected.
|
protected void |
onRecursiveImportDetected()
Invoked when a recursive import is detected.
|
void |
process(Resource resource,
Reader reader,
Writer writer)
Process a content supplied by a reader and perform some sort of processing.
|
protected static final Pattern PATTERN
public final void process(Resource resource, Reader reader, Writer writer) throws IOException
Resource, because
this way you can ignore the other preProcessors from the chain.RuntimeException and the processing chain is interrupted (by default)WroConfiguration.isIgnoreFailingProcessor() is true)process in interface ResourcePreProcessorresource - the original resource as it found in the model.reader - Reader used to read processed resource content.writer - Writer where used to write processed results.IOException - when an exception occurs. The future version will change the exception type to Exception, because
any exception may occur during processing. The processing failure will be handled based on value of
WroConfiguration.isIgnoreFailingProcessor() configuration flag.protected abstract String doTransform(String cssContent, List<Resource> importedResources) throws IOException
cssContent - the css to transform.importedResources - the list of found imports.IOExceptionprotected void onImportDetected(String foundImportUri)
foundImportUri - the uri of the detected imported resourceprotected void onRecursiveImportDetected()
public boolean isImportAware()
isImportAware in interface ImportAwareCopyright © 2008-2013. All Rights Reserved.