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
  • Constructor Details

    • ExcelGenericReferenceTranslator

      public ExcelGenericReferenceTranslator()
  • Method Details

    • canHandle

      public boolean canHandle(AttributeDescriptorModel attributeDescriptor)
      Description copied from interface: ExcelValueTranslator
      Indicates 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 String referenceFormat(AttributeDescriptorModel attributeDescriptor)
      Description copied from interface: ExcelValueTranslator
      Format 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 Optional<Object> exportData(Object objectToExport)
      Description copied from interface: ExcelValueTranslator
      Converts 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 Optional<?> exportData(AttributeDescriptorModel attributeDescriptor, Object objectToExport)
      Description copied from interface: ExcelValueTranslator
      Converts 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: ExcelValueTranslator
      Imports data based on provided importParameters for given attributeDescriptor. The method returns Impex thanks 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 imported
      importParameters - contains information about language for localized field, type code, parsed parameters inserted into excel's cell.
      Returns:
      Impex object 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 List<String> getExcludedFields()
    • setExcludedFields

      public void setExcludedFields(List<String> excludedFields)
    • setOrder

      public void setOrder(int order)
    • getOrder

      public int getOrder()