Class DefaultImportParameterParser

java.lang.Object
com.hybris.backoffice.excel.importing.parser.DefaultImportParameterParser
All Implemented Interfaces:
ImportParameterParser, org.springframework.core.Ordered

public class DefaultImportParameterParser extends Object implements ImportParameterParser
  • Constructor Details

    • DefaultImportParameterParser

      public DefaultImportParameterParser()
  • Method Details

    • matches

      public boolean matches(@Nonnull String referenceFormat)
      Specified by:
      matches in interface ImportParameterParser
    • parseDefaultValues

      public DefaultValues parseDefaultValues(String referenceFormat, String defaultValues)
      Parses referencePattern cell (which is located in the second row) and default values cell (which is located in the third row) and creates map where key is equals to reference key and value is equals to value provided in the third row. For example, for the following reference cell's value: catalog:version and default value cell: Default:Online the following map will be returned: {{key: catalog, value: Default}, {key: version, value: Online}}
      Specified by:
      parseDefaultValues in interface ImportParameterParser
      Parameters:
      referenceFormat - cell's value from second row of excel sheet
      defaultValues - cell's value from third row of excel sheet
      Returns:
      DefaultValues object. If default values are not provided then only keys will be returned.
    • parseValue

      public ParsedValues parseValue(String cellValue, DefaultValues defaultValues)
      Parses referencePattern cell (which is located in the second row) and cell with data (which is located in the data row) and creates map where key is equal to reference key and value is equals to value provided in the data row. If value is null then default value is taken into account. For example, for the following reference cell's value: catalog:version and cell's value: Default:Online the following map will be returned: {{key: catalog, value: Default}, {key: version, value: Online}}. Parameters map always contains key : ImportParameters.RAW_VALUE which represents not parsed value, but merged with default values
      Specified by:
      parseValue in interface ImportParameterParser
      Parameters:
      cellValue - value of cell's data
      defaultValues - parsed default values
      Returns:
      ParsedValues object. If default values are not provided then only keys will be returned.
    • setMatcher

      public void setMatcher(ExcelParserMatcher matcher)
    • setSplitter

      public void setSplitter(ExcelParserSplitter splitter)
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • setOrder

      public void setOrder(int order)