|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.isdc.wro.model.resource.processor.impl.css.AbstractCssImportPreProcessor
@SupportedResourceType(value=CSS) public abstract class 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.
WroConfiguration.isIgnoreMissingResources()
flag. If it is set to false, the processor will fail.
Constructor Summary | |
---|---|
AbstractCssImportPreProcessor()
|
Method Summary | |
---|---|
protected abstract String |
doTransform(String cssContent,
List<Resource> importedResources)
Perform actual transformation of provided cssContent and the list of found import resources. |
protected List<String> |
findImports(String css)
Extracts a list of imports from css content. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractCssImportPreProcessor()
Method Detail |
---|
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 ResourcePreProcessor
resource
- 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 List<String> findImports(String css)
protected abstract String doTransform(String cssContent, List<Resource> importedResources) throws IOException
cssContent
- the css to transform.importedResources
- the list of found imports.
IOException
protected void onImportDetected(String foundImportUri)
foundImportUri
- the uri of the detected imported resourceprotected void onRecursiveImportDetected()
public boolean isImportAware()
isImportAware
in interface ImportAware
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |