com.tecacet.finance.io.parser.MutualFundAssetParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jfapi Show documentation
Show all versions of jfapi Show documentation
JFApi connects to various Web Services that provide financial data such as stock prices,
splits, dividends, and FX rates.
package com.tecacet.finance.io.parser;
import com.tecacet.finance.model.Asset;
import com.tecacet.finance.model.AssetType;
import com.tecacet.jflat.CSVReader;
import org.apache.commons.csv.CSVFormat;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
public class MutualFundAssetParser {
private final CSVReader reader = CSVReader
.readerWithHeaderMapping(Asset.class, new String[] {"Fund Symbol", "Fund Name", "Type"}, new String[] {"symbol", "name", "assetType"})
.withFormat(CSVFormat.DEFAULT.withFirstRecordAsHeader().withDelimiter('|').withQuote(null))
.registerConverter(AssetType.class, s -> AssetType.MUTUAL_FUND);
public List parse(InputStream is) throws IOException {
return reader.readAll(is);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy