Class AbstractComputedProperty<T>
- java.lang.Object
-
- com.adobe.aem.commons.assetshare.content.properties.AbstractComputedProperty<T>
-
- All Implemented Interfaces:
ComputedProperty<T>
public abstract class AbstractComputedProperty<T> extends Object implements ComputedProperty<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.adobe.aem.commons.assetshare.content.properties.ComputedProperty
ComputedProperty.Types
-
-
Field Summary
-
Fields inherited from interface com.adobe.aem.commons.assetshare.content.properties.ComputedProperty
DEFAULT_ASC_COMPUTED_PROPERTY_SERVICE_RANKING
-
-
Constructor Summary
Constructors Constructor Description AbstractComputedProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(com.day.cq.dam.api.Asset asset, String propertyName)
boolean
accepts(com.day.cq.dam.api.Asset asset, org.apache.sling.api.SlingHttpServletRequest request, String propertyName)
T
get(com.day.cq.dam.api.Asset asset)
Gets the computed value for the asset.T
get(com.day.cq.dam.api.Asset asset, org.apache.sling.api.resource.ValueMap parameters)
Gets the computed value for the asset.T
get(com.day.cq.dam.api.Asset asset, org.apache.sling.api.SlingHttpServletRequest request)
Gets the computed value for the asset.T
get(com.day.cq.dam.api.Asset asset, org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.resource.ValueMap parameters)
Gets the computed value for the asset.protected org.apache.sling.api.resource.ValueMap
getAssetProperties(com.day.cq.dam.api.Asset asset)
protected com.day.cq.wcm.api.components.ComponentContext
getComponentContext(org.apache.sling.api.SlingHttpServletRequest request)
protected org.apache.sling.api.resource.ValueMap
getMetadataProperties(com.day.cq.dam.api.Asset asset)
boolean
isCachable()
Method that indicates if the result via (get(..)) is cacheable by the ComputedPropertyAccessor.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.adobe.aem.commons.assetshare.content.properties.ComputedProperty
getLabel, getName, getTypes
-
-
-
-
Method Detail
-
getComponentContext
protected com.day.cq.wcm.api.components.ComponentContext getComponentContext(org.apache.sling.api.SlingHttpServletRequest request)
-
getAssetProperties
protected org.apache.sling.api.resource.ValueMap getAssetProperties(com.day.cq.dam.api.Asset asset)
-
getMetadataProperties
protected org.apache.sling.api.resource.ValueMap getMetadataProperties(com.day.cq.dam.api.Asset asset)
-
isCachable
public boolean isCachable()
Description copied from interface:ComputedProperty
Method that indicates if the result via (get(..)) is cacheable by the ComputedPropertyAccessor. This is highly encouraged if the same computed property is called many times in the context of the same Accessor (ie Model) and the resulting value will not/should not change.The AbstractComputedProperty's implementation of this method returns true as this is the common use case.
- Specified by:
isCachable
in interfaceComputedProperty<T>
- Returns:
- true if the value is cachable by the consumer of the ComputedProperty.
-
accepts
public boolean accepts(com.day.cq.dam.api.Asset asset, String propertyName)
- Specified by:
accepts
in interfaceComputedProperty<T>
- Parameters:
asset
- the assetpropertyName
- the computed property name- Returns:
- true if this ComputedProperty should accept the handling of this invocation.
-
accepts
public boolean accepts(com.day.cq.dam.api.Asset asset, org.apache.sling.api.SlingHttpServletRequest request, String propertyName)
- Specified by:
accepts
in interfaceComputedProperty<T>
- Parameters:
asset
- the assetrequest
- the request objectpropertyName
- the computed property name- Returns:
- true if this ComputedProperty should accept the handling of this invocation.
-
get
public T get(com.day.cq.dam.api.Asset asset, org.apache.sling.api.SlingHttpServletRequest request, org.apache.sling.api.resource.ValueMap parameters)
Description copied from interface:ComputedProperty
Gets the computed value for the asset.
This is the primary get(..) method signature to implement as this is what is exposed from AssetModel's CombinedProperties- Specified by:
get
in interfaceComputedProperty<T>
- Parameters:
asset
- the assetrequest
- the requestparameters
- any parameters. If this method is implemented, it should handle the case where no parameters- Returns:
- the computed value.
-
get
public T get(com.day.cq.dam.api.Asset asset, org.apache.sling.api.SlingHttpServletRequest request)
Description copied from interface:ComputedProperty
Gets the computed value for the asset.- Specified by:
get
in interfaceComputedProperty<T>
- Parameters:
asset
- the assetrequest
- the request- Returns:
- the computed value.
-
get
public T get(com.day.cq.dam.api.Asset asset, org.apache.sling.api.resource.ValueMap parameters)
Description copied from interface:ComputedProperty
Gets the computed value for the asset.- Specified by:
get
in interfaceComputedProperty<T>
- Parameters:
asset
- the assetparameters
- any parameters. If this method is implemented, it should handle the case where no parametersters- Returns:
- the computed value.
-
get
public T get(com.day.cq.dam.api.Asset asset)
Description copied from interface:ComputedProperty
Gets the computed value for the asset.- Specified by:
get
in interfaceComputedProperty<T>
- Parameters:
asset
- the asset- Returns:
- the computed value.
-
-