Package com.hybris.cockpitng.labels.impl
Class DefaultLabelService
- java.lang.Object
-
- com.hybris.cockpitng.labels.impl.DefaultLabelService
-
- All Implemented Interfaces:
LabelService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
TypeAwareLabelService
public class DefaultLabelService extends java.lang.Object implements LabelService, org.springframework.context.ApplicationContextAware
Default implementation ofLabelServicethat usesBaseconfiguration.
-
-
Constructor Summary
Constructors Constructor Description DefaultLabelService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected <CONFIG> ConfigContextbuildConfigurationContext(ConfigContext additionalContext, java.lang.Class<CONFIG> configurationType)Deprecated, for removal: This API element is subject to removal in a future version.since 6.7 this method has no replacement.protected org.springframework.context.ApplicationContextgetApplicationContext()protected java.lang.StringgetDescriptionInternal(java.lang.Object object)protected java.lang.StringgetFallbackLabel(java.lang.Object object)protected java.lang.StringgetIconPathInternal(java.lang.Object object)protected LabelsgetLabelConfiguration(java.lang.Object object)protected java.lang.StringgetLabelInternal(java.lang.Object object, java.util.function.Function<LabelProvider,java.lang.String> provider, java.util.function.Function<Labels,java.lang.String> handler)protected LabelProvider<java.lang.Object>getLabelProvider(java.lang.Object object, Labels labelConfig)protected LabelServiceCachegetLabelServiceCache()java.lang.StringgetObjectDescription(java.lang.Object object)Returns text description for a given Object.java.lang.StringgetObjectIconPath(java.lang.Object object)Returns icon path for a given Object.java.lang.StringgetObjectLabel(java.lang.Object object)Returns label for a given Object.java.lang.StringgetShortObjectLabel(java.lang.Object object)Returns short label for a given Object.protected java.lang.StringgetType(java.lang.Object object)protected ModelValueHandlergetValueHandler()voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext)voidsetCockpitConfigurationService(CockpitConfigurationService cockpitConfigurationService)voidsetContextDecorators(java.util.List<WidgetConfigurationContextDecorator> contextDecorators)Deprecated, for removal: This API element is subject to removal in a future version.since 6.7 this method has no replacement.voidsetLabelServiceCache(LabelServiceCache labelServiceCache)voidsetLabelStringObjectHandler(LabelStringObjectHandler labelStringObjectHandler)voidsetModelValueHandlerFactory(ModelValueHandlerFactory modelValueHandlerFactory)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hybris.cockpitng.labels.LabelService
getAccessDeniedLabel, getLanguageDisabledLabel
-
-
-
-
Method Detail
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
- Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware
-
getApplicationContext
protected org.springframework.context.ApplicationContext getApplicationContext()
-
getObjectLabel
public java.lang.String getObjectLabel(java.lang.Object object)
Description copied from interface:LabelServiceReturns label for a given Object.- Specified by:
getObjectLabelin interfaceLabelService- Parameters:
object- target object- Returns:
- label for a given object
-
getShortObjectLabel
public java.lang.String getShortObjectLabel(java.lang.Object object)
Description copied from interface:LabelServiceReturns short label for a given Object. By default delegates toLabelService.getObjectLabel(Object).- Specified by:
getShortObjectLabelin interfaceLabelService- Parameters:
object- target object- Returns:
- label for a given object
- See Also:
LabelService.getObjectLabel(java.lang.Object)
-
getLabelInternal
protected java.lang.String getLabelInternal(java.lang.Object object, java.util.function.Function<LabelProvider,java.lang.String> provider, java.util.function.Function<Labels,java.lang.String> handler)
-
getFallbackLabel
protected java.lang.String getFallbackLabel(java.lang.Object object)
-
getObjectDescription
public java.lang.String getObjectDescription(java.lang.Object object)
Description copied from interface:LabelServiceReturns text description for a given Object.- Specified by:
getObjectDescriptionin interfaceLabelService- Parameters:
object- target object- Returns:
- description for a given object
-
getDescriptionInternal
protected java.lang.String getDescriptionInternal(java.lang.Object object)
-
getObjectIconPath
public java.lang.String getObjectIconPath(java.lang.Object object)
Description copied from interface:LabelServiceReturns icon path for a given Object.- Specified by:
getObjectIconPathin interfaceLabelService- Parameters:
object- target object- Returns:
- icon path for a given object
-
getIconPathInternal
protected java.lang.String getIconPathInternal(java.lang.Object object)
-
getLabelConfiguration
protected Labels getLabelConfiguration(java.lang.Object object)
-
buildConfigurationContext
@Deprecated(since="6.7", forRemoval=true) protected <CONFIG> ConfigContext buildConfigurationContext(ConfigContext additionalContext, java.lang.Class<CONFIG> configurationType)Deprecated, for removal: This API element is subject to removal in a future version.since 6.7 this method has no replacement. If you need to decorate the context for the label service subclass from this class and implement the decorating logic. This method will be removed along with the complementarysetContextDecorators(List)method.
-
getType
protected java.lang.String getType(java.lang.Object object)
-
getLabelProvider
protected LabelProvider<java.lang.Object> getLabelProvider(java.lang.Object object, Labels labelConfig)
-
getValueHandler
protected ModelValueHandler getValueHandler()
-
setCockpitConfigurationService
public void setCockpitConfigurationService(CockpitConfigurationService cockpitConfigurationService)
-
setModelValueHandlerFactory
public void setModelValueHandlerFactory(ModelValueHandlerFactory modelValueHandlerFactory)
-
setContextDecorators
@Deprecated(since="6.7", forRemoval=true) public void setContextDecorators(java.util.List<WidgetConfigurationContextDecorator> contextDecorators)Deprecated, for removal: This API element is subject to removal in a future version.since 6.7 this method has no replacement. If you need to decorate the context for the label service subclass from this class and implement the decorating logic. This method will be removed along with the complementarybuildConfigurationContext(ConfigContext, Class)method.
-
setLabelStringObjectHandler
public void setLabelStringObjectHandler(LabelStringObjectHandler labelStringObjectHandler)
-
setLabelServiceCache
public void setLabelServiceCache(LabelServiceCache labelServiceCache)
-
getLabelServiceCache
protected LabelServiceCache getLabelServiceCache()
-
-