Class ImportedDataItem

java.lang.Object
io.jmix.dataimport.extractor.data.ImportedDataItem
All Implemented Interfaces:
RawValuesSource

public class ImportedDataItem extends Object implements RawValuesSource
Represents a source of raw values for properties for one entity to import.
Contains the following info:
  • Item index:
    1. CSV, XLSX - row number;
    2. JSON - index of JSON object in the object array;
    3. XML - sequential number of XML child element in the root element.
  • Raw values map:
    1. CSV, XLSX - string cell values by column names;
    2. JSON - field values by field names. As a field value can be: string (for all simple fields), ImportedObject or ImportedObjectList;
    3. XML - tag value by tag names. As a tag value can be: string (for tags without child tags), ImportedObject or ImportedObjectList.
  • Field Details

    • rawValues

      protected Map<String,Object> rawValues
    • itemIndex

      protected int itemIndex
  • Constructor Details

    • ImportedDataItem

      public ImportedDataItem()
  • Method Details

    • getItemIndex

      public int getItemIndex()
    • getRawValues

      public Map<String,Object> getRawValues()
      Specified by:
      getRawValues in interface RawValuesSource
      Returns:
      map that contains raw values by data field names
    • setItemIndex

      public void setItemIndex(int itemIndex)
    • setRawValues

      public void setRawValues(Map<String,Object> rawValues)
      Description copied from interface: RawValuesSource
      Sets a map containing raw values of data fields.
      Specified by:
      setRawValues in interface RawValuesSource
      Parameters:
      rawValues - map with raw values
    • addRawValue

      public ImportedDataItem addRawValue(String dataFieldName, @Nullable Object value)
      Description copied from interface: RawValuesSource
      Adds a raw value of specified data field
      Specified by:
      addRawValue in interface RawValuesSource
      Parameters:
      dataFieldName - data field name
      value - raw value
      Returns:
      current instance of raw values source
    • getRawValue

      @Nullable public Object getRawValue(String dataFieldName)
      Description copied from interface: RawValuesSource
      Gets a raw value of the specified data field
      Specified by:
      getRawValue in interface RawValuesSource
      Parameters:
      dataFieldName - data field name
      Returns:
      extracted raw value
    • toString

      public String toString()
      Overrides:
      toString in class Object