|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectro.isdc.wro.model.resource.processor.impl.css.AbstractCssUrlRewritingProcessor
@SupportedResourceType(value=CSS) public abstract class AbstractCssUrlRewritingProcessor
A processor responsible for rewriting url's from inside the css resources.
| Field Summary | |
|---|---|
protected static Pattern |
PATTERN
Compiled pattern. |
| Constructor Summary | |
|---|---|
AbstractCssUrlRewritingProcessor()
|
|
| Method Summary | |
|---|---|
protected String |
cleanImageUrl(String imageUrl)
Cleans the image url by triming result and removing \' or \" characters if such exists. |
protected boolean |
isReplaceNeeded(String url)
Check if url must be replaced or not. |
protected void |
onProcessCompleted()
Invoked when the process operation is completed. |
protected void |
onUrlReplaced(String replacedUrl)
Invoked when an url is replaced. |
void |
process(Reader reader,
Writer writer)
Perform actual resource processing. |
void |
process(Resource resource,
Reader reader,
Writer writer)
Process a content supplied by a reader and perform some sort of processing. |
protected abstract String |
replaceImageUrl(String cssUri,
String imageUrl)
Replace provided url with the new url if needed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Pattern PATTERN
| Constructor Detail |
|---|
public AbstractCssUrlRewritingProcessor()
| Method Detail |
|---|
public void process(Reader reader,
Writer writer)
throws IOException
process in interface ResourcePostProcessorreader - source stream.writer - destination stream.
IOException
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.
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 IO exception occurs.protected void onProcessCompleted()
protected void onUrlReplaced(String replacedUrl)
replacedUrl - the newly computed url created as a result of url rewriting.
protected abstract String replaceImageUrl(String cssUri,
String imageUrl)
cssUri - Uri of the parsed css.imageUrl - to replace.
protected final String cleanImageUrl(String imageUrl)
imageUrl - to clean.
protected boolean isReplaceNeeded(String url)
url - to check.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||