Class AtomicValueTranslator
java.lang.Object
de.hybris.platform.impex.jalo.translators.AbstractValueTranslator
de.hybris.platform.impex.jalo.translators.SingleValueTranslator
de.hybris.platform.impex.jalo.translators.AtomicValueTranslator
- Direct Known Subclasses:
DocumentIDTranslator
-
Constructor Summary
ConstructorsConstructorDescriptionAtomicValueTranslator(AttributeDescriptor attributeDescriptor, Class javaClass) AtomicValueTranslator(Class javaClass) -
Method Summary
Modifier and TypeMethodDescriptionprotected ObjectconvertToJalo(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.protected AttributeDescriptorReturns the assigned AttributeDescriptor.protected DateFormatReturns the DateFormat or a default one.protected StringgetDateFormatString(AbstractDescriptor columnDescriptor) Returns a default DateFormat with the default formating and the default locale.Returns a default NumberFormat instance constructed with configured locale orLocale.Germanas default.protected NumberFormatReturns the NumberFormat or a default one.protected StringgetNumberFormatString(AbstractDescriptor columnDescriptor) protected booleanholdsUnresolvableItems(Object object) voidinit(StandardColumnDescriptor columnDescriptor) Called once per header creation to allow configuring this translator using column modifiers etc.protected booleanisSupportedClass(Class myClass) voidsetDateFormat(String format) voidsetDateFormat(DateFormat format) Sets the date format used for date translation.voidSets the locale used for default formats to another one (default is session locale).voidsetNumberFormat(String format) voidsetNumberFormat(NumberFormat format) Sets the number format used for number translation.voidvalidate(StandardColumnDescriptor columnDescriptor) Validates the value translator once per header creation.Methods 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
-
AtomicValueTranslator
-
AtomicValueTranslator
-
-
Method Details
-
setLocale
Sets the locale used for default formats to another one (default is session locale).- Parameters:
locale- locale to use for value translation with default formats
-
setDateFormat
Sets the date format used for date translation. If set to null the default format will be used (seegetDefaultDateFormat()).- Parameters:
format- date format to use for date translation
-
setDateFormat
-
setNumberFormat
Sets the number format used for number translation. If set to null the default format will be used (seegetDefaultNumberFormat()).- Parameters:
format- number format to use for number translation
-
setNumberFormat
-
getAttributeDescriptor
Returns the assigned AttributeDescriptor.- Returns:
- the assigned attributeDescriptor, which could be
null!!
-
getDateFormatString
-
getNumberFormatString
-
getDateFormat
Returns the DateFormat or a default one.- Returns:
- DateFormat
-
getNumberFormat
Returns the NumberFormat or a default one.- Returns:
- NumberFormat
-
getDefaultNumberFormat
Returns a default NumberFormat instance constructed with configured locale orLocale.Germanas default.- Returns:
- NumberFormat
-
getDefaultDateFormat
Returns a default DateFormat with the default formating and the default locale.- Returns:
- DateFormat
-
init
Description copied from class:AbstractValueTranslatorCalled once per header creation to allow configuring this translator using column modifiers etc.- Overrides:
initin classAbstractValueTranslator- Parameters:
columnDescriptor- descriptor where the value to translate belongs to
-
validate
Description copied from class:AbstractValueTranslatorValidates the value translator once per header creation.- Overrides:
validatein classAbstractValueTranslator- Parameters:
columnDescriptor- descriptor where the value to translate belongs to- Throws:
HeaderValidationException- validation has thrown errors
-
isSupportedClass
-
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
-
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
-
holdsUnresolvableItems
-