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
public static class Europe1PricesTranslator.Europe1PriceRowTranslator extends Europe1RowTranslator
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 theEurope1RowTranslator.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
Constructors Constructor Description Europe1PriceRowTranslator()
Europe1PriceRowTranslator(java.text.SimpleDateFormat dateFormat, java.text.NumberFormat numberFormat, java.util.Locale loc)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
convertToJalo(java.lang.String valueExpr, Item forItem)
Converts a non-null and non-empty string into a jalo attribute value.protected java.lang.String
convertToString(java.lang.Object value)
Converts a non-null jalo attribute value into its string representation.void
init(StandardColumnDescriptor columnDescriptor)
Called once per header creation to allow configuring this translator using column modifiers etc.void
validate(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, transformStartDate
-
Methods inherited from class de.hybris.platform.impex.jalo.translators.SingleValueTranslator
exportValue, getEmptyValue, importValue, isEmpty
-
Methods 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
-
-
-
-
Method Detail
-
validate
public void validate(StandardColumnDescriptor standardcd) throws HeaderValidationException
Description copied from class:AbstractValueTranslator
Validates the value translator once per header creation.- Overrides:
validate
in classAbstractValueTranslator
- Parameters:
standardcd
- descriptor where the value to translate belongs to- Throws:
HeaderValidationException
- validation has thrown errors
-
init
public void init(StandardColumnDescriptor columnDescriptor)
Description copied from class:AbstractValueTranslator
Called once per header creation to allow configuring this translator using column modifiers etc.- Overrides:
init
in classEurope1RowTranslator
- Parameters:
columnDescriptor
- descriptor where the value to translate belongs to
-
convertToJalo
public java.lang.Object convertToJalo(java.lang.String valueExpr, Item forItem)
Description copied from class:SingleValueTranslator
Converts a non-null and non-empty string into a jalo attribute value.- Specified by:
convertToJalo
in classSingleValueTranslator
- Parameters:
valueExpr
- string to translateforItem
- item instance the translated value will be set to as attribute- Returns:
- Object translated value
-
convertToString
protected java.lang.String convertToString(java.lang.Object value)
Description copied from class:SingleValueTranslator
Converts a non-null jalo attribute value into its string representation.- Specified by:
convertToString
in classSingleValueTranslator
- Parameters:
value
- value to translate- Returns:
- translated value
-
-