org.apache.shindig.gadgets.rewrite
Class TemplateRewriter

java.lang.Object
  extended by org.apache.shindig.gadgets.rewrite.TemplateRewriter
All Implemented Interfaces:
GadgetRewriter

public class TemplateRewriter
extends Object
implements GadgetRewriter

This ContentRewriter uses a TemplateProcessor to replace os-template tag contents of a gadget spec with their rendered equivalents. Only templates without the @name and @tag attributes are processed automatically.


Field Summary
static String OSML_FEATURE_NAME
           
static Set<String> TAGS
           
static String TEMPLATES_FEATURE_NAME
           
 
Constructor Summary
TemplateRewriter(com.google.inject.Provider<TemplateProcessor> processor, MessageBundleFactory messageBundleFactory, Expressions expressions, TagRegistry baseTagRegistry, TemplateLibraryFactory libraryFactory, ContainerTagLibraryFactory containerTags)
           
 
Method Summary
 void rewrite(Gadget gadget, MutableContent content)
          Rewrite the gadget.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAGS

public static final Set<String> TAGS

TEMPLATES_FEATURE_NAME

public static final String TEMPLATES_FEATURE_NAME
See Also:
Constant Field Values

OSML_FEATURE_NAME

public static final String OSML_FEATURE_NAME
See Also:
Constant Field Values
Constructor Detail

TemplateRewriter

@Inject
public TemplateRewriter(com.google.inject.Provider<TemplateProcessor> processor,
                               MessageBundleFactory messageBundleFactory,
                               Expressions expressions,
                               TagRegistry baseTagRegistry,
                               TemplateLibraryFactory libraryFactory,
                               ContainerTagLibraryFactory containerTags)
Method Detail

rewrite

public void rewrite(Gadget gadget,
                    MutableContent content)
             throws RewritingException
Description copied from interface: GadgetRewriter
Rewrite the gadget.

Specified by:
rewrite in interface GadgetRewriter
Parameters:
gadget - Gadget to rewrite.
content - the content of the gadget to be manipulated.
Throws:
RewritingException


Copyright © 2007-2012. All Rights Reserved.