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
public class ExcelGenericReferenceTranslator extends AbstractValidationAwareTranslator
Default generic translator for all references
-
-
Field Summary
-
Fields inherited from class com.hybris.backoffice.excel.translators.AbstractValidationAwareTranslator
validators
-
-
Constructor Summary
Constructors Constructor Description ExcelGenericReferenceTranslator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanHandle(AttributeDescriptorModel attributeDescriptor)Indicates whether the translator can handle given attribute descriptor.java.util.Optional<?>exportData(AttributeDescriptorModel attributeDescriptor, java.lang.Object objectToExport)Converts given object to value which should be put into cell of exported excel file.java.util.Optional<java.lang.Object>exportData(java.lang.Object objectToExport)Converts given object to value which should be put into cell of exported excel file.java.util.List<java.lang.String>getExcludedFields()ExportDataFactorygetExportDataFactory()ImportImpexFactorygetImportImpexFactory()intgetOrder()ReferenceFormatFactorygetReferenceFormatFactory()RequiredAttributesFactorygetRequiredAttributesFactory()TypeServicegetTypeService()ImpeximportData(AttributeDescriptorModel attributeDescriptor, ImportParameters importParameters)Imports data based on provided importParameters for given attributeDescriptor.java.lang.StringreferenceFormat(AttributeDescriptorModel attributeDescriptor)Format how a reference should be presented.voidsetExcludedFields(java.util.List<java.lang.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, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.hybris.backoffice.excel.translators.ExcelValueTranslator
canHandle
-
-
-
-
Method Detail
-
canHandle
public boolean canHandle(AttributeDescriptorModel attributeDescriptor)
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
public java.lang.String referenceFormat(AttributeDescriptorModel attributeDescriptor)
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
public java.util.Optional<java.lang.Object> exportData(java.lang.Object objectToExport)
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
public java.util.Optional<?> exportData(AttributeDescriptorModel attributeDescriptor, java.lang.Object objectToExport)
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
public RequiredAttributesFactory getRequiredAttributesFactory()
-
setRequiredAttributesFactory
public void setRequiredAttributesFactory(RequiredAttributesFactory requiredAttributesFactory)
-
getReferenceFormatFactory
public ReferenceFormatFactory getReferenceFormatFactory()
-
setReferenceFormatFactory
public void setReferenceFormatFactory(ReferenceFormatFactory referenceFormatFactory)
-
getExportDataFactory
public ExportDataFactory getExportDataFactory()
-
setExportDataFactory
public void setExportDataFactory(ExportDataFactory exportDataFactory)
-
getImportImpexFactory
public ImportImpexFactory getImportImpexFactory()
-
setImportImpexFactory
public void setImportImpexFactory(ImportImpexFactory importImpexFactory)
-
getTypeService
public TypeService getTypeService()
-
setTypeService
public void setTypeService(TypeService typeService)
-
getExcludedFields
public java.util.List<java.lang.String> getExcludedFields()
-
setExcludedFields
public void setExcludedFields(java.util.List<java.lang.String> excludedFields)
-
setOrder
public void setOrder(int order)
-
getOrder
public int getOrder()
-
-