Class ExcelJavaTypeTranslator
java.lang.Object
com.hybris.backoffice.excel.translators.AbstractValidationAwareTranslator<T>
com.hybris.backoffice.excel.translators.AbstractExcelValueTranslator<Object>
com.hybris.backoffice.excel.translators.ExcelJavaTypeTranslator
- All Implemented Interfaces:
ExcelValueTranslator<Object>,org.springframework.core.Ordered
Translates java types like: numbers, boolean values and dates. Dates are exported in format:
ExcelDateUtils.getDateTimeFormat(). Dates are exported in ExcelDateUtils.getExportTimeZone() time
zone. During import date is treated as in export time zone so it's converted back into system time zone (default is
UTC).-
Field Summary
Fields inherited from class com.hybris.backoffice.excel.translators.AbstractExcelValueTranslator
orderFields inherited from class com.hybris.backoffice.excel.translators.AbstractValidationAwareTranslator
validatorsFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanHandle(AttributeDescriptorModel attributeDescriptorModel) Indicates whether the translator can handle given attribute descriptor.exportData(Object objectToExport) Converts given object to value which should be put into cell of exported excel file.protected ImpexValueimportDate(AttributeDescriptorModel attributeDescriptor, ImportParameters importParameters) importValue(AttributeDescriptorModel attributeDescriptor, ImportParameters importParameters) Imports single value instead of whole Impex object.referenceFormat(AttributeDescriptorModel attributeDescriptor) Format how a reference should be presented.voidsetExcelDateUtils(ExcelDateUtils excelDateUtils) voidsetExcelUniqueFilter(ExcelFilter<AttributeDescriptorModel> excelUniqueFilter) voidsetMandatoryFilter(ExcelFilter<AttributeDescriptorModel> mandatoryFilter) Methods inherited from class com.hybris.backoffice.excel.translators.AbstractExcelValueTranslator
getOrder, getTypeService, importData, isLocalizedOfType, setOrder, setTypeServiceMethods inherited from class com.hybris.backoffice.excel.translators.AbstractValidationAwareTranslator
getValidators, setValidators, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hybris.backoffice.excel.translators.ExcelValueTranslator
canHandle, exportData
-
Constructor Details
-
ExcelJavaTypeTranslator
public ExcelJavaTypeTranslator()
-
-
Method Details
-
canHandle
Description copied from interface:ExcelValueTranslatorIndicates whether the translator can handle given attribute descriptor. This method is Recommended during importing excel file.- Parameters:
attributeDescriptorModel-AttributeDescriptorModel- Returns:
- whether the translator can handle request
-
exportData
Description copied from interface:ExcelValueTranslatorConverts given object to value which should be put into cell of exported excel file.- Returns:
- value which will be put into cell of exported excel file.
-
importValue
public ImpexValue importValue(AttributeDescriptorModel attributeDescriptor, ImportParameters importParameters) Description copied from class:AbstractExcelValueTranslatorImports single value instead of whole Impex object. Impex value consists of header and value.- Specified by:
importValuein classAbstractExcelValueTranslator<Object>- Parameters:
attributeDescriptor-AttributeDescriptorModeldescribes attribute which should be importedimportParameters- - contains information about language for localized field, type code, parsed parameters inserted into excel's cell.- Returns:
ImpexValuevalue which should be imported
-
importDate
protected ImpexValue importDate(AttributeDescriptorModel attributeDescriptor, ImportParameters importParameters) -
referenceFormat
Description copied from interface:ExcelValueTranslatorFormat how a reference should be presented. Usually references consist of a few fields indicated as unique. Therefore all unique attributes should be included in the format. Example reference format: "catalog:version"- Parameters:
attributeDescriptor-AttributeDescriptorModel- Returns:
- Format how a reference should be presented
-
getExcelDateUtils
-
setExcelDateUtils
-
getExcelUniqueFilter
-
setExcelUniqueFilter
-
getMandatoryFilter
-
setMandatoryFilter
-