public class GadgetSpec extends Object
| Modifier and Type | Field and Description |
|---|---|
static Locale |
DEFAULT_LOCALE |
static String |
DEFAULT_VIEW |
static String |
DOCTYPE_QUIRKSMODE |
protected ExternalServices |
externalServices
ExternalServices
|
protected ModulePrefs |
modulePrefs
ModulePrefs
|
protected Map<String,UserPref> |
userPrefs
UserPref
|
protected Map<String,View> |
views
Content
Mapping is view -> Content section.
|
| Modifier | Constructor and Description |
|---|---|
protected |
GadgetSpec(GadgetSpec spec)
Constructs a GadgetSpec for substitute calls.
|
|
GadgetSpec(Uri url,
Element doc,
String original)
Creates a new Module from the given xml input.
|
|
GadgetSpec(Uri url,
String xml)
Use for testing.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getAttribute(String key) |
String |
getChecksum() |
ExternalServices |
getExternalServices() |
ModulePrefs |
getModulePrefs() |
OpenSocialVersion |
getSpecificationVersion()
Returns this Gadget's specification version.
|
Uri |
getUrl() |
Map<String,UserPref> |
getUserPrefs() |
View |
getView(String name)
Retrieves a single view by name.
|
Map<String,View> |
getViews() |
GadgetSpec |
removeUrlViews()
Returns a copy of the spec with all type=url views removed.
|
void |
setAttribute(String key,
Object o)
Sets an attribute on the gadget spec.
|
GadgetSpec |
substitute(Substitutions substituter)
Performs substitutions on the spec.
|
String |
toString() |
public static final String DEFAULT_VIEW
public static final Locale DEFAULT_LOCALE
public static final String DOCTYPE_QUIRKSMODE
protected ModulePrefs modulePrefs
protected ExternalServices externalServices
public GadgetSpec(Uri url, Element doc, String original) throws SpecParserException
url - The original url of the gadget.doc - The pre-parsed xml document.original - Unparsed input XML. Used to generate checksums.SpecParserException - If xml can not be processed as a valid gadget spec.public GadgetSpec(Uri url, String xml) throws SpecParserException
SpecParserExceptionprotected GadgetSpec(GadgetSpec spec)
spec - public OpenSocialVersion getSpecificationVersion()
public Uri getUrl()
public String getChecksum()
public ModulePrefs getModulePrefs()
public ExternalServices getExternalServices()
public View getView(String name)
name - The name of the view you want to seepublic void setAttribute(String key, Object o)
key - The attribute name.o - The value of the attribute.public GadgetSpec substitute(Substitutions substituter)
substituter - public GadgetSpec removeUrlViews()
Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.