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 classCSVFromPropertiesReader.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.CSVFromPropertiesReaderBuilderbuilder(java.io.Reader reader)voidclose()Close the reader.voidcloseQuietly()Close the reader quietly.java.util.Map<java.lang.Integer,java.lang.String>getOrCreateCSVLineForID(java.lang.String id)protected booleanisComplete(java.util.Map<java.lang.Integer,java.lang.String> csvLine)java.lang.IntegerlookupPosition(de.hybris.platform.util.CSVFromPropertiesReader.ParsedProperty property)protected java.util.Map<java.lang.Integer,java.lang.String>parseNextCSVLine()protected de.hybris.platform.util.CSVFromPropertiesReader.ParsedPropertyparseNextProperty()protected java.lang.StringreadNextPropertyLine()protected java.lang.StringreadSrcLineFromStream()Reads next line from stream.protected voidremoveFromBuffer(java.lang.String id)protected java.lang.StringtoCsv(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:CSVReaderReads next line from stream. If stream has reached end,nullis returned and finished flag will be set.- Overrides:
readSrcLineFromStreamin 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.IOExceptionDescription copied from class:CSVReaderClose the reader. Should be always called if parsing is finished.
-
closeQuietly
public void closeQuietly()
Description copied from class:CSVReaderClose the reader quietly. The IOException will be catched and if the debug mode is enabled the exeption message is written to the log.- Overrides:
closeQuietlyin classCSVReader
-
-