org.apache.shindig.gadgets.spec
Class View

java.lang.Object
  extended by org.apache.shindig.gadgets.spec.View
All Implemented Interfaces:
RequestAuthenticationInfo

public class View
extends Object
implements RequestAuthenticationInfo

Represents a Content section, but normalized into an individual view value after views are split on commas.


Nested Class Summary
static class View.ContentType
          Possible values for Content/@type
 
Constructor Summary
View(String name, List<Element> elements, Uri base)
           
 
Method Summary
 Map<String,String> getAttributes()
           
 AuthType getAuthType()
           
 String getContent()
           
 Uri getHref()
           
 String getName()
           
 PipelinedData getPipelinedData()
          All os: preloads.
 int getPreferredHeight()
           
 int getPreferredWidth()
           
 boolean getQuirks()
           
 String getRawType()
           
 View.ContentType getType()
           
 boolean isSignOwner()
           
 boolean isSignViewer()
           
 boolean needsUserPrefSubstitution()
           
 void setHrefContent(String content)
          Set content for a type=html, href=URL style gadget.
 View substitute(Substitutions substituter)
          Creates a new view by performing hangman substitution.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

View

public View(String name,
            List<Element> elements,
            Uri base)
     throws SpecParserException
Parameters:
name - The name of this view.
elements - List of all views, in order, that make up this view. An ordered list is required per the spec, since values must overwrite one another.
base - The base url to resolve href against.
Throws:
SpecParserException
Method Detail

getName

public String getName()

getType

public View.ContentType getType()

getRawType

public String getRawType()

getHref

public Uri getHref()
Specified by:
getHref in interface RequestAuthenticationInfo
Returns:
The destination URI for making authenticated requests to.

getQuirks

public boolean getQuirks()

getPreferredHeight

public int getPreferredHeight()

getPreferredWidth

public int getPreferredWidth()

getContent

public String getContent()

setHrefContent

public void setHrefContent(String content)
Set content for a type=html, href=URL style gadget. This is the last bastion of GadgetSpec mutability, and should only be used for the described case. Call nulls out href in order to indicate content was successfully retrieved.

Parameters:
content - New gadget content retrieved from href.

needsUserPrefSubstitution

public boolean needsUserPrefSubstitution()

getAuthType

public AuthType getAuthType()
Specified by:
getAuthType in interface RequestAuthenticationInfo
Returns:
The type of authentication to use.

isSignOwner

public boolean isSignOwner()
Specified by:
isSignOwner in interface RequestAuthenticationInfo
Returns:
True if owner signing is needed.

isSignViewer

public boolean isSignViewer()
Specified by:
isSignViewer in interface RequestAuthenticationInfo
Returns:
True if viewer signing is needed.

getAttributes

public Map<String,String> getAttributes()
Specified by:
getAttributes in interface RequestAuthenticationInfo
Returns:
A map of all relevant auth-related attributes.

getPipelinedData

public PipelinedData getPipelinedData()
All os: preloads.


substitute

public View substitute(Substitutions substituter)
Creates a new view by performing hangman substitution. See field comments for details on what gets substituted.

Parameters:
substituter -
Returns:
The substituted view.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2007-2012. All Rights Reserved.