Class DefaultScheduleLinePopulator
- java.lang.Object
-
- de.hybris.platform.sap.sapordermgmtservices.converters.populator.DefaultScheduleLinePopulator
-
- All Implemented Interfaces:
Populator<Schedline,ScheduleLineData>
public class DefaultScheduleLinePopulator extends java.lang.Object implements Populator<Schedline,ScheduleLineData>
Populates ScheduleLineData from the BOL representation of schedule lines
-
-
Constructor Summary
Constructors Constructor Description DefaultScheduleLinePopulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringconvertBigDecimalToString(java.math.BigDecimal quantity, java.lang.String unit)Converts a big decimal into localized format, taking the unit customizing into account.protected java.lang.StringconvertDateToLongDateString(java.util.Date date)Converts a date to a localized stringprotected java.lang.StringconvertDoubleToString(java.lang.Double input)Converts a double to a localized string, according to the session localeprotected java.lang.StringgetFormattedDate(java.util.Date date, java.util.Locale locale)Formats schedule line date according to the current session localeGenericFactorygetGenericFactory()I18NServicegetI18NService()voidpopulate(Schedline source, ScheduleLineData target)Populate the target instance with values from the source instance.voidsetGenericFactory(GenericFactory genericFactory)Sets generic factory (to access SAP session beans) via spring injectionvoidsetI18NService(I18NService i18nService)
-
-
-
Method Detail
-
populate
public void populate(Schedline source, ScheduleLineData target) throws ConversionException
Description copied from interface:PopulatorPopulate the target instance with values from the source instance.- Specified by:
populatein interfacePopulator<Schedline,ScheduleLineData>- Parameters:
source- the source objecttarget- the target to fill- Throws:
ConversionException- if an error occurs
-
getI18NService
public I18NService getI18NService()
- Returns:
- the i18NService
-
setI18NService
public void setI18NService(I18NService i18nService)
- Parameters:
i18nService- the i18NService to set
-
getFormattedDate
protected java.lang.String getFormattedDate(java.util.Date date, java.util.Locale locale)Formats schedule line date according to the current session locale- Parameters:
date-locale- Session locale- Returns:
- Schedule line date in localized format, using
DateFormat.LONG
-
getGenericFactory
public GenericFactory getGenericFactory()
- Returns:
- Factory to access SAP session beans
-
setGenericFactory
public void setGenericFactory(GenericFactory genericFactory)
Sets generic factory (to access SAP session beans) via spring injection- Parameters:
genericFactory-
-
convertDateToLongDateString
protected java.lang.String convertDateToLongDateString(java.util.Date date)
Converts a date to a localized string- Parameters:
date-- Returns:
- Date string, localized according the session locale
-
convertDoubleToString
protected java.lang.String convertDoubleToString(java.lang.Double input)
Converts a double to a localized string, according to the session locale- Parameters:
input- conversion input- Returns:
- String, localized according to the session locale
-
convertBigDecimalToString
protected java.lang.String convertBigDecimalToString(java.math.BigDecimal quantity, java.lang.String unit)Converts a big decimal into localized format, taking the unit customizing into account. If there are no decimal places however, we donn't display a decimal separator- Parameters:
quantity-unit-- Returns:
- Localized string (considering unit customizing)
-
-