Class DefaultCoverageCalculationService
- java.lang.Object
-
- de.hybris.platform.validation.coverage.impl.DefaultCoverageCalculationService
-
- All Implemented Interfaces:
CoverageCalculationService
public class DefaultCoverageCalculationService extends java.lang.Object implements CoverageCalculationService
Default implementation of coverage calculation service. This implementation of theCoverageCalculationServiceusesCoverageCalculationStrategyRegistryto lookup matching strategy and redirect the calculation to it.
-
-
Constructor Summary
Constructors Constructor Description DefaultCoverageCalculationService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CoverageInfocalculate(ItemModel item, java.lang.String domainId)Calculates the coverage of the givenitem.CoverageInfocalculate(ItemModel item, java.lang.String templateCode, java.lang.String domainId)Calculates the coverage of the givenitem.voidsetStrategyRegistry(CoverageCalculationStrategyRegistry strategyRegistry)
-
-
-
Method Detail
-
calculate
public CoverageInfo calculate(ItemModel item, java.lang.String domainId)
Description copied from interface:CoverageCalculationServiceCalculates the coverage of the givenitem. ThedomainIdcan by used to distinguish between multiple coverage calculation strategies per domain (e.g. text translation coverage, print related coverage etc.)- Specified by:
calculatein interfaceCoverageCalculationService- Parameters:
item- the item to calculate the coverage fordomainId- the domain Id if applicable- Returns:
- the
CoverageInfoobject with cumulated coverage information ornullif no strategy was registered for given item and domain ID
-
calculate
public CoverageInfo calculate(ItemModel item, java.lang.String templateCode, java.lang.String domainId)
Description copied from interface:CoverageCalculationServiceCalculates the coverage of the givenitem. ThedomainIdcan by used to distinguish between multiple coverage calculation strategies per domain (e.g. text translation coverage, print related coverage etc.)- Specified by:
calculatein interfaceCoverageCalculationService- Parameters:
item- the item to calculate the coverage fortemplateCode- the item template to be used for finding the proper calculation strategydomainId- the domain Id if applicable- Returns:
- the
CoverageInfoobject with cumulated coverage information ornullif no strategy was registered for given item and domain ID
-
setStrategyRegistry
public void setStrategyRegistry(CoverageCalculationStrategyRegistry strategyRegistry)
-
-