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
JsonException
public ResourceID getId()
getId
in interface SocialComponent
public java.lang.String getResourceType()
getResourceType
in interface SocialComponent
public java.lang.String getUrl()
getUrl
in interface SocialComponent
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
getProperties
in interface SocialComponent
public <T> T getProperty(java.lang.String name, java.lang.Class<T> type)
getProperty
in interface SocialComponent
T
- typename
- name/key of the propertytype
- Classpublic <T> T getProperty(java.lang.String name, T defaultValue)
getProperty
in interface SocialComponent
T
- 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 SocialComponent
tidy
- true to return readable JSON string.JsonException
- if an error occurs during serialization.public Resource getResource()
getResource
in interface SocialComponent
public java.util.Map<java.lang.String,java.lang.Object> getAsMap()
getAsMap
in interface SocialComponent
public SocialComponent getParentComponent()
SocialComponent
getParentComponent
in interface SocialComponent
public SocialComponent getSourceComponent()
SocialComponent
getSourceComponent
in interface SocialComponent
public java.lang.String getFriendlyUrl()
SocialComponent
getFriendlyUrl
in interface SocialComponent
Copyright © 2010 - 2020 Adobe. All Rights Reserved