Class ExcelGenericReferenceTranslator
java.lang.Object
com.hybris.backoffice.excel.translators.AbstractValidationAwareTranslator
com.hybris.backoffice.excel.translators.generic.ExcelGenericReferenceTranslator
- All Implemented Interfaces:
ExcelValueTranslator,org.springframework.core.Ordered
Default generic translator for all references
-
Field Summary
Fields 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 attributeDescriptor) Indicates whether the translator can handle given attribute descriptor.Optional<?>exportData(AttributeDescriptorModel attributeDescriptor, Object objectToExport) Converts given object to value which should be put into cell of exported excel file.exportData(Object objectToExport) Converts given object to value which should be put into cell of exported excel file.intgetOrder()importData(AttributeDescriptorModel attributeDescriptor, ImportParameters importParameters) Imports data based on provided importParameters for given attributeDescriptor.referenceFormat(AttributeDescriptorModel attributeDescriptor) Format how a reference should be presented.voidsetExcludedFields(List<String> excludedFields) voidsetExportDataFactory(ExportDataFactory exportDataFactory) voidsetImportImpexFactory(ImportImpexFactory importImpexFactory) voidsetOrder(int order) voidsetReferenceFormatFactory(ReferenceFormatFactory referenceFormatFactory) voidsetRequiredAttributesFactory(RequiredAttributesFactory requiredAttributesFactory) voidsetTypeService(TypeService typeService) Methods 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
-
Constructor Details
-
ExcelGenericReferenceTranslator
public ExcelGenericReferenceTranslator()
-
-
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:
attributeDescriptor-AttributeDescriptorModel- Returns:
- whether the translator can handle request
-
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
-
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.
-
exportData
Description copied from interface:ExcelValueTranslatorConverts given object to value which should be put into cell of exported excel file.- Parameters:
attributeDescriptor-AttributeDescriptorModel- Returns:
- value which will be put into cell of exported excel file.
-
importData
public Impex importData(AttributeDescriptorModel attributeDescriptor, ImportParameters importParameters) Description copied from interface:ExcelValueTranslatorImports data based on provided importParameters for given attributeDescriptor. The method returnsImpexthanks to that it is possible to creating additional entries ( or example creating part-of entries: product - price row, ect.)- Parameters:
attributeDescriptor- describes attribute which should be importedimportParameters- contains information about language for localized field, type code, parsed parameters inserted into excel's cell.- Returns:
Impexobject which is representation of impex script.
-
getRequiredAttributesFactory
-
setRequiredAttributesFactory
-
getReferenceFormatFactory
-
setReferenceFormatFactory
-
getExportDataFactory
-
setExportDataFactory
-
getImportImpexFactory
-
setImportImpexFactory
-
getTypeService
-
setTypeService
-
getExcludedFields
-
setExcludedFields
-
setOrder
public void setOrder(int order) -
getOrder
public int getOrder()
-