Interface ExcelValueTranslator<T>

    • Method Detail

      • canHandle

        boolean canHandle​(AttributeDescriptorModel attributeDescriptorModel)
        Indicates whether the translator can handle given attribute descriptor.
        Parameters:
        attributeDescriptorModel - AttributeDescriptorModel
        Returns:
        whether the translator can handle request
      • exportData

        java.util.Optional<java.lang.Object> exportData​(T objectToExport)
        Converts given object to value which should be put into cell of exported excel file.
        Parameters:
        objectToExport -
        Returns:
        value which will be put into cell of exported excel file.
      • exportData

        default java.util.Optional<java.lang.Object> exportData​(AttributeDescriptorModel attributeDescriptorModel,
                                                                T objectToExport)
        Converts given object to value which should be put into cell of exported excel file.
        Parameters:
        attributeDescriptorModel - AttributeDescriptorModel
        objectToExport -
        Returns:
        value which will be put into cell of exported excel file.
      • importData

        Impex importData​(AttributeDescriptorModel attributeDescriptor,
                         ImportParameters importParameters)
        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.
      • referenceFormat

        default java.lang.String referenceFormat​(AttributeDescriptorModel attributeDescriptor)
        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