public class BaseSocialComponent extends Object implements SocialComponent
CSV_SELECTOR, DEFAULT_SELECTOR, INDEX_SELECTOR, PROP_REFERER, QUERY_SELECTOR, TRANSLATE_SELECTOR| Constructor and Description |
|---|
BaseSocialComponent(Resource resource,
ClientUtilities clientUtils) |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildJSONString(Map<String,Object> data,
boolean tidy) |
Map<String,Object> |
getAsMap() |
String |
getFriendlyUrl()
Get a url that can be used to display this component, most of the time, this is the page url that contains the
component.
|
ResourceID |
getId() |
SocialComponent |
getParentComponent()
Gets the immediate parent of this component.
|
Map<String,Object> |
getProperties() |
<T> T |
getProperty(String name,
Class<T> type)
Get the resource value for the specified key.
|
<T> T |
getProperty(String name,
T defaultValue)
Get the resource value for the specified key, if the property doesn't exist, return the specified default
value.
|
Resource |
getResource() |
String |
getResourceType() |
SocialComponent |
getSourceComponent()
Gets the SocialComponent that created this piece of UGC.
|
String |
getUrl() |
String |
toJSONString(boolean tidy) |
public BaseSocialComponent(Resource resource, ClientUtilities clientUtils)
resource - the resource for which this BaseSocialComponent will be created for.clientUtils - an instance of ClientUtilities for accessing helper methods for XSS support and generating
URLs.public static String buildJSONString(Map<String,Object> data, boolean tidy) throws JsonException
JsonExceptionpublic ResourceID getId()
getId in interface SocialComponentpublic String getResourceType()
getResourceType in interface SocialComponentpublic String getUrl()
getUrl in interface SocialComponentpublic Map<String,Object> getProperties()
getProperties in interface SocialComponentpublic <T> T getProperty(String name, Class<T> type)
getProperty in interface SocialComponentpublic <T> T getProperty(String name, T defaultValue)
getProperty in interface SocialComponentname - the name of the propertydefaultValue - a non null default value to be returned by this method if the specified property does not
existpublic String toJSONString(boolean tidy) throws JsonException
toJSONString in interface SocialComponenttidy - true to return readable JSON string.JsonException - if an error occurs during serialization.public Resource getResource()
getResource in interface SocialComponentpublic Map<String,Object> getAsMap()
getAsMap in interface SocialComponentpublic SocialComponent getParentComponent()
SocialComponentgetParentComponent in interface SocialComponentpublic SocialComponent getSourceComponent()
SocialComponentgetSourceComponent in interface SocialComponentpublic String getFriendlyUrl()
SocialComponentgetFriendlyUrl in interface SocialComponent"Copyright © 2010 - 2017 Adobe Systems Incorporated. All Rights Reserved"