org.apache.shindig.gadgets
Class Gadget

java.lang.Object
  extended by org.apache.shindig.gadgets.Gadget

public class Gadget
extends Object

Intermediary representation of all state associated with processing of a single gadget request.


Constructor Summary
Gadget()
           
 
Method Summary
 void addFeature(String name)
           
 List<String> getAllFeatures()
           
 GadgetContext getContext()
           
 View getCurrentView()
           
 Set<String> getDirectFeatureDeps()
           
 LocaleSpec getLocale()
          Convenience function for getting the locale spec for the current context.
 Collection<PreloadedData> getPreloads()
           
 GadgetSpec getSpec()
           
 void removeFeature(String name)
           
 boolean sanitizeOutput()
          Should the gadget content be sanitized on output
 Gadget setContext(GadgetContext context)
           
 Gadget setCurrentView(View currentView)
           
 Gadget setGadgetFeatureRegistry(FeatureRegistry registry)
           
 Gadget setPreloads(Collection<PreloadedData> preloads)
           
 Gadget setSpec(GadgetSpec spec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Gadget

public Gadget()
Method Detail

setContext

public Gadget setContext(GadgetContext context)
Parameters:
context - The request that the gadget is being processed for.

getContext

public GadgetContext getContext()

setGadgetFeatureRegistry

public Gadget setGadgetFeatureRegistry(FeatureRegistry registry)
Parameters:
registry - The gadget feature registry to use to find dependent features.

setSpec

public Gadget setSpec(GadgetSpec spec)
Parameters:
spec - The spec for the gadget that is being processed.

getSpec

public GadgetSpec getSpec()

setPreloads

public Gadget setPreloads(Collection<PreloadedData> preloads)
Parameters:
preloads - The preloads for the gadget that is being processed.

getPreloads

public Collection<PreloadedData> getPreloads()

getAllFeatures

public List<String> getAllFeatures()

setCurrentView

public Gadget setCurrentView(View currentView)

getCurrentView

public View getCurrentView()
Returns:
The View applicable for the current request.

getLocale

public LocaleSpec getLocale()
Convenience function for getting the locale spec for the current context. Identical to: Locale locale = gadget.getContext().getLocale(); gadget.getSpec().getModulePrefs().getLocale(locale);


addFeature

public void addFeature(String name)

removeFeature

public void removeFeature(String name)

getDirectFeatureDeps

public Set<String> getDirectFeatureDeps()

sanitizeOutput

public boolean sanitizeOutput()
Should the gadget content be sanitized on output

Returns:


Copyright © 2007-2012. All Rights Reserved.