com.activequant.utils
Class CsvMapReader

java.lang.Object
  extended by com.activequant.utils.CsvMapReader

public class CsvMapReader
extends Object

Event based, stream reader, will read CSV lines from a stream and will then fire an event to an event listener.

Author:
ustaudinger

Constructor Summary
CsvMapReader()
           
 
Method Summary
 void read(IEventListener<Map<String,String>> eventListener, InputStream inputStream)
          will replace all " and ' with nothing.
 void setHeader(String[] header)
          use for files without header.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CsvMapReader

public CsvMapReader()
Method Detail

setHeader

public void setHeader(String[] header)
use for files without header. if set, read in header will be ignored.


read

public void read(IEventListener<Map<String,String>> eventListener,
                 InputStream inputStream)
          throws Exception
will replace all " and ' with nothing. reads in streaming manner. Trims values to remove whitespace.

Parameters:
eventListener -
fileName -
Throws:
IOException
Exception


Copyright © 2012 ActiveQuant GmbH. All Rights Reserved.