Class DefaultCoverageCalculationService

java.lang.Object
de.hybris.platform.validation.coverage.impl.DefaultCoverageCalculationService
All Implemented Interfaces:
CoverageCalculationService

public class DefaultCoverageCalculationService extends Object implements CoverageCalculationService
Default implementation of coverage calculation service. This implementation of the CoverageCalculationService uses CoverageCalculationStrategyRegistry to lookup matching strategy and redirect the calculation to it.
  • Constructor Details

    • DefaultCoverageCalculationService

      public DefaultCoverageCalculationService()
  • Method Details

    • calculate

      public CoverageInfo calculate(ItemModel item, String domainId)
      Description copied from interface: CoverageCalculationService
      Calculates the coverage of the given item. The domainId can by used to distinguish between multiple coverage calculation strategies per domain (e.g. text translation coverage, print related coverage etc.)
      Specified by:
      calculate in interface CoverageCalculationService
      Parameters:
      item - the item to calculate the coverage for
      domainId - the domain Id if applicable
      Returns:
      the CoverageInfo object with cumulated coverage information or null if no strategy was registered for given item and domain ID
    • calculate

      public CoverageInfo calculate(ItemModel item, String templateCode, String domainId)
      Description copied from interface: CoverageCalculationService
      Calculates the coverage of the given item. The domainId can by used to distinguish between multiple coverage calculation strategies per domain (e.g. text translation coverage, print related coverage etc.)
      Specified by:
      calculate in interface CoverageCalculationService
      Parameters:
      item - the item to calculate the coverage for
      templateCode - the item template to be used for finding the proper calculation strategy
      domainId - the domain Id if applicable
      Returns:
      the CoverageInfo object with cumulated coverage information or null if no strategy was registered for given item and domain ID
    • setStrategyRegistry

      public void setStrategyRegistry(CoverageCalculationStrategyRegistry strategyRegistry)