public class CssResponseRewriter extends Object implements ResponseRewriter
| Modifier and Type | Class and Description |
|---|---|
static class |
CssResponseRewriter.UriMaker |
| Modifier and Type | Field and Description |
|---|---|
protected ProxyUriManager |
proxyUriManager |
protected ContentRewriterFeature.Factory |
rewriterFeatureFactory |
| Constructor and Description |
|---|
CssResponseRewriter(CajaCssParser cssParser,
ProxyUriManager proxyUriManager,
ContentRewriterFeature.Factory rewriterFeatureFactory) |
| Modifier and Type | Method and Description |
|---|---|
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,
Gadget gadget)
Rewrites the response.
|
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) |
protected final ProxyUriManager proxyUriManager
protected final ContentRewriterFeature.Factory rewriterFeatureFactory
@Inject public CssResponseRewriter(CajaCssParser cssParser, ProxyUriManager proxyUriManager, ContentRewriterFeature.Factory rewriterFeatureFactory)
public void rewrite(HttpRequest request, HttpResponseBuilder original, Gadget gadget) throws RewritingException
ResponseRewriterrewrite in interface ResponseRewriterrequest - The request that was made.original - The response generated as a result of the request.gadget - The gadget that made the request. This parameter may be null.RewritingException - Thrown if something went wrong when rewriting the response.public List<String> rewrite(Reader content, Uri source, CssResponseRewriter.UriMaker uriMaker, Writer writer, boolean extractImports, GadgetContext gadgetContext) throws RewritingException
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 gadgetContextRewritingExceptionpublic List<String> rewrite(Element styleNode, Uri source, CssResponseRewriter.UriMaker uriMaker, boolean extractImports, GadgetContext gadgetContext) throws RewritingException
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 gadgetContextRewritingExceptionpublic static List<String> rewrite(com.google.caja.parser.css.CssTree.StyleSheet styleSheet, Uri source, CssResponseRewriter.UriMaker uriMaker, boolean extractImports, GadgetContext gadgetContext)
styleSheet - To rewritesource - Uri of contenturiMaker - a UriMakerextractImports - If true remove the import statements from the output and return their
referenced URIs.public static CssResponseRewriter.UriMaker uriMaker(ProxyUriManager wrapped, ContentRewriterFeature.Config config)
Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.