Class Europe1PricesTranslator.Europe1PriceRowTranslator
java.lang.Object
de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
de.hybris.platform.impex.jalo.translators.SingleValueTranslator
de.hybris.platform.europe1.jalo.impex.Europe1RowTranslator
de.hybris.platform.europe1.jalo.impex.Europe1PricesTranslator.Europe1PriceRowTranslator
- Enclosing class:
- Europe1PricesTranslator
Translates a single price (row) expression. All prices are assigned to the imported product directly.
Syntax:
( ({user}|{userPriceGroup})? {quantity} {unitCode} '=')?
{price} ({currencyISO}|{currencySign}) ('B'|'N'|'G')?
('['{from}','{to}']')? ({priceRowChannel})?
Some examples:
- '10 EUR' ... creates a PriceRow with min quantity 1, unit taken from product, 10 as price and the 'USD' currency
- '2 pieces = 10 $' ... creates a PriceRow with min quantity 2, unit pieces, 10 as price and the currency with $ as sign
- ' axel 20 pieces = 3,20 BP' ... creates a PriceRow for customer axel, with min quantity 20, unit pieces, 3,20 as price and the the 'BP' currency
- '10 EUR [01.01.2005,31.12.2005]' ... creates a PriceRow with min quantity 1, unit taken from product, 10 as price and the 'EUR' currency, which is active from 01.01.2005 until 31.12.2005
dateformat modifier and pay
attention for the fact, that the time of the end date is transformed to 23:59:59 if it was imported as 00:00:00.
If you want to disable this transformation logic, override the
Europe1RowTranslator.transformEndDate(java.util.Date) method.-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.europe1.jalo.impex.Europe1RowTranslator
Europe1RowTranslator.ParsedCurrency -
Constructor Summary
ConstructorsConstructorDescriptionEurope1PriceRowTranslator(SimpleDateFormat dateFormat, NumberFormat numberFormat, Locale loc) -
Method Summary
Modifier and TypeMethodDescriptionconvertToJalo(String valueExpr, Item forItem) Converts a non-null and non-empty string into a jalo attribute value.protected StringconvertToString(Object value) Converts a non-null jalo attribute value into its string representation.voidinit(StandardColumnDescriptor columnDescriptor) Called once per header creation to allow configuring this translator using column modifiers etc.voidvalidate(StandardColumnDescriptor standardcd) Validates the value translator once per header creation.Methods inherited from class de.hybris.platform.europe1.jalo.impex.Europe1RowTranslator
getCurrenciesISOs, getCurrenciesSymbols, getDateFormat, getDateFormatString, getNumberFormat, getNumberFormatString, parseCurrency, parseDateRange, transformEndDate, transformStartDateMethods inherited from class de.hybris.platform.impex.jalo.translators.SingleValueTranslator
exportValue, getEmptyValue, importValue, isEmptyMethods inherited from class de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
clearStatus, createTranslator, createTranslator, createTranslator, debug, error, getColumnDescriptor, getFlexibleSearch, info, isDebugEnabled, isInfoEnabled, setEmpty, setError, warn, wasEmpty, wasUnresolved
-
Constructor Details
-
Europe1PriceRowTranslator
public Europe1PriceRowTranslator() -
Europe1PriceRowTranslator
public Europe1PriceRowTranslator(SimpleDateFormat dateFormat, NumberFormat numberFormat, Locale loc)
-
-
Method Details
-
validate
Description copied from class:AbstractValueTranslatorValidates the value translator once per header creation.- Overrides:
validatein classAbstractValueTranslator- Parameters:
standardcd- descriptor where the value to translate belongs to- Throws:
HeaderValidationException- validation has thrown errors
-
init
Description copied from class:AbstractValueTranslatorCalled once per header creation to allow configuring this translator using column modifiers etc.- Overrides:
initin classEurope1RowTranslator- Parameters:
columnDescriptor- descriptor where the value to translate belongs to
-
convertToJalo
Description copied from class:SingleValueTranslatorConverts a non-null and non-empty string into a jalo attribute value.- Specified by:
convertToJaloin classSingleValueTranslator- Parameters:
valueExpr- string to translateforItem- item instance the translated value will be set to as attribute- Returns:
- Object translated value
-
convertToString
Description copied from class:SingleValueTranslatorConverts a non-null jalo attribute value into its string representation.- Specified by:
convertToStringin classSingleValueTranslator- Parameters:
value- value to translate- Returns:
- translated value
-