org.apache.shindig.gadgets.rewrite
Class DefaultResponseRewriterRegistry

java.lang.Object
  extended by org.apache.shindig.gadgets.rewrite.DefaultResponseRewriterRegistry
All Implemented Interfaces:
ResponseRewriterRegistry
Direct Known Subclasses:
AccelResponseRewriterRegistry

public class DefaultResponseRewriterRegistry
extends Object
implements ResponseRewriterRegistry

Basic registry -- just iterates over rewriters and invokes them sequentially.

Since:
2.0.0

Field Summary
protected  GadgetHtmlParser htmlParser
           
protected  List<ResponseRewriter> rewriters
           
 
Constructor Summary
DefaultResponseRewriterRegistry(List<ResponseRewriter> rewriters, GadgetHtmlParser htmlParser)
           
 
Method Summary
 HttpResponse rewriteHttpResponse(HttpRequest req, HttpResponse resp)
          Rewrites an HttpResponse object with the given request as context, using the registered rewriters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rewriters

protected final List<ResponseRewriter> rewriters

htmlParser

protected final GadgetHtmlParser htmlParser
Constructor Detail

DefaultResponseRewriterRegistry

@Inject
public DefaultResponseRewriterRegistry(List<ResponseRewriter> rewriters,
                                              GadgetHtmlParser htmlParser)
Method Detail

rewriteHttpResponse

public HttpResponse rewriteHttpResponse(HttpRequest req,
                                        HttpResponse resp)
                                 throws RewritingException
Rewrites an HttpResponse object with the given request as context, using the registered rewriters.

Specified by:
rewriteHttpResponse in interface ResponseRewriterRegistry
Parameters:
req - Request object for context.
resp - Original response object.
Returns:
Rewritten response object, or resp if not modified.
Throws:
RewritingException


Copyright © 2007-2012. All Rights Reserved.