Package de.hybris.platform.util
Class CSVFromPropertiesReader
- java.lang.Object
-
- de.hybris.platform.util.CSVReader
-
- de.hybris.platform.util.CSVFromPropertiesReader
-
public class CSVFromPropertiesReader extends CSVReader
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CSVFromPropertiesReader.CSVFromPropertiesReaderBuilder
-
Constructor Summary
Constructors Constructor Description CSVFromPropertiesReader(java.lang.String idAndNameRegexp, java.util.Map<java.lang.String,java.lang.Integer> name2columns, boolean caseInsentitiveAttributeNames, int linesToBuffer, java.lang.String emptyCellValue, java.io.Reader reader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.lang.Integer,java.lang.String>
addPropertyToCSVLine(de.hybris.platform.util.CSVFromPropertiesReader.ParsedProperty property)
static CSVFromPropertiesReader.CSVFromPropertiesReaderBuilder
builder(java.io.Reader reader)
void
close()
Close the reader.void
closeQuietly()
Close the reader quietly.java.util.Map<java.lang.Integer,java.lang.String>
getOrCreateCSVLineForID(java.lang.String id)
protected boolean
isComplete(java.util.Map<java.lang.Integer,java.lang.String> csvLine)
java.lang.Integer
lookupPosition(de.hybris.platform.util.CSVFromPropertiesReader.ParsedProperty property)
protected java.util.Map<java.lang.Integer,java.lang.String>
parseNextCSVLine()
protected de.hybris.platform.util.CSVFromPropertiesReader.ParsedProperty
parseNextProperty()
protected java.lang.String
readNextPropertyLine()
protected java.lang.String
readSrcLineFromStream()
Reads next line from stream.protected void
removeFromBuffer(java.lang.String id)
protected java.lang.String
toCsv(java.util.Map<java.lang.Integer,java.lang.String> csv)
-
Methods inherited from class de.hybris.platform.util.CSVReader
applyDecorators, clearAllCellDecorators, clearCellDecorator, finished, getCellDecorator, getCommentOut, getCurrentLineNumber, getDecoratorMap, getFieldSeparator, getLine, getSourceLine, getTextSeparator, hasCellDecorators, isCommentedOut, isFinished, isMultiLineMode, isReading, isShowComments, markFinished, mustSkip, notifyNextLine, parse, parse, parse, parse, parseLine, readNextLine, setCellDecorator, setCommentOut, setFieldSeparator, setLinesToSkip, setMaxBufferLines, setMultiLineMode, setShowComments, setTextSeparator, trim
-
-
-
-
Method Detail
-
builder
public static CSVFromPropertiesReader.CSVFromPropertiesReaderBuilder builder(java.io.Reader reader)
-
readSrcLineFromStream
protected java.lang.String readSrcLineFromStream()
Description copied from class:CSVReader
Reads next line from stream. If stream has reached end,null
is returned and finished flag will be set.- Overrides:
readSrcLineFromStream
in classCSVReader
- Returns:
- next line from stream or
null
-
toCsv
protected java.lang.String toCsv(java.util.Map<java.lang.Integer,java.lang.String> csv)
-
parseNextCSVLine
protected java.util.Map<java.lang.Integer,java.lang.String> parseNextCSVLine() throws java.io.IOException
- Throws:
java.io.IOException
-
isComplete
protected boolean isComplete(java.util.Map<java.lang.Integer,java.lang.String> csvLine)
-
parseNextProperty
protected de.hybris.platform.util.CSVFromPropertiesReader.ParsedProperty parseNextProperty() throws java.io.IOException
- Throws:
java.io.IOException
-
readNextPropertyLine
protected java.lang.String readNextPropertyLine() throws java.io.IOException
- Throws:
java.io.IOException
-
removeFromBuffer
protected void removeFromBuffer(java.lang.String id)
-
addPropertyToCSVLine
protected java.util.Map<java.lang.Integer,java.lang.String> addPropertyToCSVLine(de.hybris.platform.util.CSVFromPropertiesReader.ParsedProperty property)
-
lookupPosition
public java.lang.Integer lookupPosition(de.hybris.platform.util.CSVFromPropertiesReader.ParsedProperty property)
-
getOrCreateCSVLineForID
public java.util.Map<java.lang.Integer,java.lang.String> getOrCreateCSVLineForID(java.lang.String id)
-
close
public void close() throws java.io.IOException
Description copied from class:CSVReader
Close the reader. Should be always called if parsing is finished.
-
closeQuietly
public void closeQuietly()
Description copied from class:CSVReader
Close the reader quietly. The IOException will be catched and if the debug mode is enabled the exeption message is written to the log.- Overrides:
closeQuietly
in classCSVReader
-
-