org.apache.shindig.gadgets.rewrite
Class CssResponseRewriter
java.lang.Object
org.apache.shindig.gadgets.rewrite.CssResponseRewriter
- All Implemented Interfaces:
- ResponseRewriter
public class CssResponseRewriter
- extends Object
- implements ResponseRewriter
Rewrite links to referenced content in a stylesheet
- Since:
- 2.0.0
|
Method Summary |
static List<String> |
rewrite(com.google.caja.parser.css.CssTree.StyleSheet styleSheet,
Uri source,
CssResponseRewriter.UriMaker uriMaker,
boolean extractImports,
GadgetContext gadgetContext)
Rewrite the CSS DOM in place. |
List<String> |
rewrite(Element styleNode,
Uri source,
CssResponseRewriter.UriMaker uriMaker,
boolean extractImports,
GadgetContext gadgetContext)
Rewrite the CSS content in a style DOM node. |
void |
rewrite(HttpRequest request,
HttpResponseBuilder original)
|
List<String> |
rewrite(Reader content,
Uri source,
CssResponseRewriter.UriMaker uriMaker,
Writer writer,
boolean extractImports,
GadgetContext gadgetContext)
Rewrite the given CSS content and optionally extract the import references. |
static CssResponseRewriter.UriMaker |
uriMaker(ProxyUriManager wrapped,
ContentRewriterFeature.Config config)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CssResponseRewriter
@Inject
public CssResponseRewriter(CajaCssParser cssParser,
ProxyUriManager proxyUriManager,
ContentRewriterFeature.Factory rewriterFeatureFactory)
rewrite
public void rewrite(HttpRequest request,
HttpResponseBuilder original)
throws RewritingException
- Specified by:
rewrite in interface ResponseRewriter
- Throws:
RewritingException
rewrite
public List<String> rewrite(Reader content,
Uri source,
CssResponseRewriter.UriMaker uriMaker,
Writer writer,
boolean extractImports,
GadgetContext gadgetContext)
throws RewritingException
- Rewrite the given CSS content and optionally extract the import references.
- Parameters:
content - CSS contentsource - Uri of contenturiMaker - a Uri Makerwriter - OutputextractImports - If true remove the import statements from the output and return their
referenced URIs.gadgetContext - The gadgetContext
- Returns:
- Empty list of extracted import URIs.
- Throws:
RewritingException
rewrite
public List<String> rewrite(Element styleNode,
Uri source,
CssResponseRewriter.UriMaker uriMaker,
boolean extractImports,
GadgetContext gadgetContext)
throws RewritingException
- Rewrite the CSS content in a style DOM node.
- Parameters:
styleNode - Rewrite the CSS content of this nodesource - Uri of contenturiMaker - a UriMakerextractImports - If true remove the import statements from the output and return their
referenced URIs.gadgetContext - The gadgetContext
- Returns:
- Empty list of extracted import URIs.
- Throws:
RewritingException
rewrite
public static List<String> rewrite(com.google.caja.parser.css.CssTree.StyleSheet styleSheet,
Uri source,
CssResponseRewriter.UriMaker uriMaker,
boolean extractImports,
GadgetContext gadgetContext)
- Rewrite the CSS DOM in place.
- Parameters:
styleSheet - To rewritesource - Uri of contenturiMaker - a UriMakerextractImports - If true remove the import statements from the output and return their
referenced URIs.
- Returns:
- Empty list of extracted import URIs.
uriMaker
public static CssResponseRewriter.UriMaker uriMaker(ProxyUriManager wrapped,
ContentRewriterFeature.Config config)
Copyright © 2007-2012. All Rights Reserved.