Class 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 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:
        read in interface io.atlasmap.spi.AtlasFieldReader
        Throws:
        io.atlasmap.api.AtlasException
      • readSchema

        public io.atlasmap.v2.Document readSchema()
                                           throws io.atlasmap.api.AtlasException
        Reads 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:
        Document built from CSV
        Throws:
        io.atlasmap.api.AtlasException - if it fails