Class ValueFormatTranslatorImpl

java.lang.Object
de.hybris.platform.sap.productconfig.facades.impl.ValueFormatTranslatorImpl
All Implemented Interfaces:
ValueFormatTranslator

public class ValueFormatTranslatorImpl extends Object implements ValueFormatTranslator
Default implementation of the ValueFormatTranslator.
  • Constructor Details

    • ValueFormatTranslatorImpl

      public ValueFormatTranslatorImpl()
  • Method Details

    • initialValue

      protected static DecimalFormat initialValue()
    • parse

      public String parse(UiType uiType, String value)
      Description copied from interface: ValueFormatTranslator
      Converts a characteristic value into an internal format, which is used by the underlying API's.
      Specified by:
      parse in interface ValueFormatTranslator
      Parameters:
      uiType - UI type the characteristic value belongs to
      value - characteristic value in external format
      Returns:
      characteristic value in internal format
    • parseNumeric

      public String parseNumeric(String value)
      Description copied from interface: ValueFormatTranslator
      Parses numerical value from UI to service
      Specified by:
      parseNumeric in interface ValueFormatTranslator
      Parameters:
      value - value to be parsed
      Returns:
      formatted numerical value
    • formatNumeric

      public String formatNumeric(String value)
      Description copied from interface: ValueFormatTranslator
      Formats numerical value from service to UI
      Specified by:
      formatNumeric in interface ValueFormatTranslator
      Parameters:
      value - value to be parsed
      Returns:
      formatted numerical value
    • formatDate

      public String formatDate(Date date)
      Description copied from interface: ValueFormatTranslator
      Format date value from service to UI
      Specified by:
      formatDate in interface ValueFormatTranslator
      Parameters:
      date - Date value which should be formatted
      Returns:
      the formatted date value
    • getLocale

      protected Locale getLocale()
    • createFormatterForUI

      protected DecimalFormat createFormatterForUI(Locale locale)
    • createFormatterForService

      protected DecimalFormat createFormatterForService()
    • format

      public String format(CsticModel cstic, String value)
      Description copied from interface: ValueFormatTranslator
      Converts a characteristic value into an external format suitable for UI-Display.
      Specified by:
      format in interface ValueFormatTranslator
      Parameters:
      cstic - characteristic the value belongs to
      value - characteristic value in internal format
      Returns:
      characteristic value in external format
    • isNumericCsticType

      public boolean isNumericCsticType(CsticModel model)
      Description copied from interface: ValueFormatTranslator
      Checks the characteristic model whether it is either of type float or integer
      Specified by:
      isNumericCsticType in interface ValueFormatTranslator
      Parameters:
      model - characteristic to be checked
      Returns:
      true if characteristic is numeric
    • setI18NService

      public void setI18NService(I18NService i18nService)
      Parameters:
      i18nService - the i18NService to set
    • getI18NService

      public I18NService getI18NService()
      Returns:
      the i18NService