public class BaseSocialComponent extends java.lang.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 java.lang.String |
buildJSONString(java.util.Map<java.lang.String,java.lang.Object> data,
boolean tidy) |
java.util.Map<java.lang.String,java.lang.Object> |
getAsMap() |
java.lang.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.
|
java.util.Map<java.lang.String,java.lang.Object> |
getProperties() |
<T> T |
getProperty(java.lang.String name,
java.lang.Class<T> type)
Get the resource value for the specified key.
|
<T> T |
getProperty(java.lang.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() |
java.lang.String |
getResourceType() |
SocialComponent |
getSourceComponent()
Gets the SocialComponent that created this piece of UGC.
|
java.lang.String |
getUrl() |
java.lang.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 java.lang.String buildJSONString(java.util.Map<java.lang.String,java.lang.Object> data,
boolean tidy)
throws JsonException
JsonExceptionpublic ResourceID getId()
getId in interface SocialComponentpublic java.lang.String getResourceType()
getResourceType in interface SocialComponentpublic java.lang.String getUrl()
getUrl in interface SocialComponentpublic java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties in interface SocialComponentpublic <T> T getProperty(java.lang.String name,
java.lang.Class<T> type)
getProperty in interface SocialComponentT - typename - name/key of the propertytype - Classpublic <T> T getProperty(java.lang.String name,
T defaultValue)
getProperty in interface SocialComponentT - typename - the name of the propertydefaultValue - a non null default value to be returned by this method if the specified property does not
existpublic java.lang.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 java.util.Map<java.lang.String,java.lang.Object> getAsMap()
getAsMap in interface SocialComponentpublic SocialComponent getParentComponent()
SocialComponentgetParentComponent in interface SocialComponentpublic SocialComponent getSourceComponent()
SocialComponentgetSourceComponent in interface SocialComponentpublic java.lang.String getFriendlyUrl()
SocialComponentgetFriendlyUrl in interface SocialComponentCopyright © 2010 - 2023 Adobe. All Rights Reserved