Package io.atlasmap.csv.core
Class CsvFieldReader
- java.lang.Object
-
- io.atlasmap.csv.core.CsvFieldReader
-
- All Implemented Interfaces:
io.atlasmap.spi.AtlasFieldReader
public class CsvFieldReader extends Object implements io.atlasmap.spi.AtlasFieldReader
It accepts InputStream as a document in order to process big files efficiently. It uses the mark operation of the InputStream to reset the stream and read consecutive fields. If InputStream does not support the mark operation it is wrapped in BufferedInputStream.
-
-
Constructor Summary
Constructors Constructor Description CsvFieldReader(CsvConfig csvConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.atlasmap.v2.Fieldread(io.atlasmap.spi.AtlasInternalSession session)io.atlasmap.v2.DocumentreadSchema()Reads only the first row of the document.voidsetDocument(InputStream inputStream)
-
-
-
Constructor Detail
-
CsvFieldReader
public CsvFieldReader(CsvConfig csvConfig)
-
-
Method Detail
-
setDocument
public void setDocument(InputStream inputStream)
-
read
public io.atlasmap.v2.Field read(io.atlasmap.spi.AtlasInternalSession session) throws io.atlasmap.api.AtlasException- Specified by:
readin interfaceio.atlasmap.spi.AtlasFieldReader- Throws:
io.atlasmap.api.AtlasException
-
readSchema
public io.atlasmap.v2.Document readSchema() throws io.atlasmap.api.AtlasExceptionReads only the first row of the document. If firstRecordAsHeader is set to true it uses column names for field names, otherwise it uses an index starting from 0.- Returns:
Documentbuilt from CSV- Throws:
io.atlasmap.api.AtlasException- if it fails
-
-