public abstract class ResourceMutateVisitor extends Object implements DomWalker.Visitor
resourceTags and prepares list of html tag nodes whose uri
attributes can be mutated.
Implementations can override mutateUris(org.apache.shindig.gadgets.Gadget, java.util.Collection<org.w3c.dom.Node>) for uses cases like
proxying resources, making url's absolute, prefetching images etc.
TODO: Refactor AbsolutePathReferenceVisitor to extend ResourceMutateVisitor.| Modifier and Type | Class and Description |
|---|---|
static class |
ResourceMutateVisitor.Tags
Enum for resource tags and associated attributes that should be mutated.
|
DomWalker.Visitor.VisitStatus| Modifier and Type | Field and Description |
|---|---|
protected ContentRewriterFeature.Config |
featureConfig |
protected Map<String,String> |
resourceTags |
| Constructor and Description |
|---|
ResourceMutateVisitor(ContentRewriterFeature.Config featureConfig,
ResourceMutateVisitor.Tags... resourceTags) |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Collection<Pair<Node,Uri>> |
mutateUris(Gadget gadget,
Collection<Node> nodes) |
boolean |
revisit(Gadget gadget,
List<Node> nodes)
Revisit a node in the DOM that was marked by the
visit(Gadget, Node) as reserved during DOM traversal. |
DomWalker.Visitor.VisitStatus |
visit(Gadget gadget,
Node node)
Visit a particular Node in the DOM.
|
protected final ContentRewriterFeature.Config featureConfig
public ResourceMutateVisitor(ContentRewriterFeature.Config featureConfig, ResourceMutateVisitor.Tags... resourceTags)
public DomWalker.Visitor.VisitStatus visit(Gadget gadget, Node node) throws RewritingException
visit in interface DomWalker.Visitorgadget - Context for the request.node - Node being visited.VisitStatusRewritingExceptionpublic boolean revisit(Gadget gadget, List<Node> nodes) throws RewritingException
visit(Gadget, Node) as reserved during DOM traversal.revisit in interface DomWalker.Visitorgadget - Context for the request.nodes - Nodes being revisited, previously marked as reserved.RewritingExceptionprotected abstract Collection<Pair<Node,Uri>> mutateUris(Gadget gadget, Collection<Node> nodes)
Copyright © 2007-2012. All Rights Reserved.