Class ProductConfigRuleFormatTranslatorImpl

java.lang.Object
de.hybris.platform.sap.productconfig.rules.service.impl.ProductConfigRuleFormatTranslatorImpl
All Implemented Interfaces:
ProductConfigRuleFormatTranslator

public class ProductConfigRuleFormatTranslatorImpl extends Object implements ProductConfigRuleFormatTranslator
Default implementation of the ProductConfigRuleFormatTranslator.
  • Constructor Details

    • ProductConfigRuleFormatTranslatorImpl

      public ProductConfigRuleFormatTranslatorImpl()
  • Method Details

    • getRulesFormat

      protected DecimalFormat getRulesFormat()
      Override this method to use a different decimal format in backoffice UI
    • getServiceFormat

      protected DecimalFormat getServiceFormat()
      Override this method if you engine use a different decimal format
    • formatForRules

      public String formatForRules(CsticModel cstic, String value)
      Description copied from interface: ProductConfigRuleFormatTranslator
      format the cstic value so that the rule engine can compare the value to it's rules maintained in backoffice
      Specified by:
      formatForRules in interface ProductConfigRuleFormatTranslator
      Parameters:
      cstic - the characteristic the value belongs to and which provides the context for translation
      value - the actual value to translate
      Returns:
      translated value
    • formatForService

      public String formatForService(CsticModel cstic, String value)
      Description copied from interface: ProductConfigRuleFormatTranslator
      format the rules value so that the configuration engine can apply the value to the runtime configuration
      Specified by:
      formatForService in interface ProductConfigRuleFormatTranslator
      Parameters:
      cstic - the characteristic the value belongs to and which provides the context for translation
      value - the actual value to translate
      Returns:
      translated value
    • canBeFormattedForService

      public boolean canBeFormattedForService(CsticModel cstic, String value)
      Description copied from interface: ProductConfigRuleFormatTranslator
      checks whether a rules value can be formatted so that the configuration engine can apply the value to the runtime configuration
      Specified by:
      canBeFormattedForService in interface ProductConfigRuleFormatTranslator
      Parameters:
      cstic - the characteristic the value belongs to and which provides the context for translation
      value - the actual value to translate
      Returns:
      true only if the given value can be formatted
    • isNumericValue

      protected boolean isNumericValue(CsticModel cstic)
    • getNoValueIndicator

      public String getNoValueIndicator()
      Specified by:
      getNoValueIndicator in interface ProductConfigRuleFormatTranslator
      Returns:
      the string indicating that no value is assigned to a ctsic at all