public class CssResponseRewriter extends Object implements ResponseRewriter
| Modifier and Type | Class and Description |
|---|---|
static class |
CssResponseRewriter.UriMaker |
| 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) |
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) |
@Inject public CssResponseRewriter(CajaCssParser cssParser, ProxyUriManager proxyUriManager, ContentRewriterFeature.Factory rewriterFeatureFactory)
public void rewrite(HttpRequest request, HttpResponseBuilder original) throws RewritingException
rewrite in interface ResponseRewriterRewritingExceptionpublic 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-2012. All Rights Reserved.