Class DefaultImportParameterParser
- java.lang.Object
-
- com.hybris.backoffice.excel.importing.parser.DefaultImportParameterParser
-
- All Implemented Interfaces:
ImportParameterParser,org.springframework.core.Ordered
public class DefaultImportParameterParser extends java.lang.Object implements ImportParameterParser
-
-
Constructor Summary
Constructors Constructor Description DefaultImportParameterParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetOrder()booleanmatches(java.lang.String referenceFormat)DefaultValuesparseDefaultValues(java.lang.String referenceFormat, java.lang.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.ParsedValuesparseValue(java.lang.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.voidsetMatcher(ExcelParserMatcher matcher)voidsetOrder(int order)voidsetSplitter(ExcelParserSplitter splitter)-
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.importing.parser.ImportParameterParser
parseValue
-
-
-
-
Method Detail
-
matches
public boolean matches(@Nonnull java.lang.String referenceFormat)- Specified by:
matchesin interfaceImportParameterParser
-
parseDefaultValues
public DefaultValues parseDefaultValues(java.lang.String referenceFormat, java.lang.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:
parseDefaultValuesin interfaceImportParameterParser- Parameters:
referenceFormat- cell's value from second row of excel sheetdefaultValues- 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(java.lang.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_VALUEwhich represents not parsed value, but merged with default values- Specified by:
parseValuein interfaceImportParameterParser- Parameters:
cellValue- value of cell's datadefaultValues- 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:
getOrderin interfaceorg.springframework.core.Ordered
-
setOrder
public void setOrder(int order)
-
-