Interface TradeCsvInfoResolver
-
public interface TradeCsvInfoResolverResolves additional information when parsing trade CSV files.Data loaded from a CSV may contain additional information that needs to be captured. This plugin point allows the additional CSV columns to be parsed and captured.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default IborCapFloorTradecompleteTrade(CsvRow row, IborCapFloorTrade trade)Completes the CapFloor trade, potentially parsing additional columns.default CdsIndexTradecompleteTrade(CsvRow row, CdsIndexTrade trade)Completes the CDS Index trade, potentially parsing additional columns.default CdsTradecompleteTrade(CsvRow row, CdsTrade trade)Completes the CDS trade, potentially parsing additional columns.default TermDepositTradecompleteTrade(CsvRow row, TermDepositTrade trade)Completes the trade, potentially parsing additional columns.default FraTradecompleteTrade(CsvRow row, FraTrade trade)Completes the FRA trade, potentially parsing additional columns.default FxNdfTradecompleteTrade(CsvRow row, FxNdfTrade trade)Completes the FX NDF trade, potentially parsing additional columns.default FxSingleTradecompleteTrade(CsvRow row, FxSingleTrade trade)Completes the FX Forward trade, potentially parsing additional columns.default FxSwapTradecompleteTrade(CsvRow row, FxSwapTrade trade)Completes the FX Swap trade, potentially parsing additional columns.default FxVanillaOptionTradecompleteTrade(CsvRow row, FxVanillaOptionTrade trade)Completes the FX Vanilla Option trade, potentially parsing additional columns.default BulletPaymentTradecompleteTrade(CsvRow row, BulletPaymentTrade trade)Completes the trade, potentially parsing additional columns.default SecurityTradecompleteTrade(CsvRow row, SecurityTrade trade)Completes the trade, potentially parsing additional columns.default SwapTradecompleteTrade(CsvRow row, SwapTrade trade)Completes the Swap trade, potentially parsing additional columns.default SwaptionTradecompleteTrade(CsvRow row, SwaptionTrade trade)Completes the Swaption trade, potentially parsing additional columns.default <T extends Trade>
TcompleteTradeCommon(CsvRow row, T trade)Completes the trade, potentially parsing additional columns.ReferenceDatagetReferenceData()Gets the reference data being used.static TradeCsvInfoResolverof(ReferenceData refData)Obtains an instance that uses the specified set of reference data.default Optional<Trade>overrideParseTrade(String typeUpper, CsvRow row, TradeInfo info)Parses any kind of trade from CSV before standard matching.default BulletPaymentTradeparseBulletPaymentTrade(CsvRow row, TradeInfo info)Parses a Bullet Payment trade from CSV.default IborCapFloorTradeparseCapFloorTrade(CsvRow row, TradeInfo info)Parses a CapFloor trade from CSV.default CdsIndexTradeparseCdsIndexTrade(CsvRow row, TradeInfo info)Parses a CDS Index trade from CSV.default CdsTradeparseCdsTrade(CsvRow row, TradeInfo info)Parses a CDS trade from CSV.default FraTradeparseFraTrade(CsvRow row, TradeInfo info)Parses a FRA trade from CSV.default FxNdfTradeparseFxNdfTrade(CsvRow row, TradeInfo info)Parses a FX NDF trade from CSV.default FxSingleTradeparseFxSingleTrade(CsvRow row, TradeInfo info)Parses a FX Single trade from CSV.default FxSwapTradeparseFxSwapTrade(CsvRow row, TradeInfo info)Parses a FX Swap trade from CSV.default FxVanillaOptionTradeparseFxVanillaOptionTrade(CsvRow row, TradeInfo info)Parses a FX Vanilla Option trade from CSV.default Optional<Trade>parseOtherTrade(String typeUpper, CsvRow row, TradeInfo info)Parses any kind of trade from CSV after standard matching.default SecurityQuantityTradeparseSecurityTrade(CsvRow row, TradeInfo info)Parses a Security trade from CSV.default voidparseStandardAttributes(CsvRow row, TradeInfoBuilder builder)Parses standard attributes intoTradeInfo.default SwaptionTradeparseSwaptionTrade(CsvRow row, List<CsvRow> variableRows, TradeInfo info)Parses a Swaption trade from CSV.default SwapTradeparseSwapTrade(CsvRow row, List<CsvRow> variableRows, TradeInfo info)Parses a Swap trade from CSV.default TermDepositTradeparseTermDepositTrade(CsvRow row, TradeInfo info)Parses a Term Deposit trade from CSV.default voidparseTradeInfo(CsvRow row, TradeInfoBuilder builder)Parses attributes intoTradeInfo.static TradeCsvInfoResolverstandard()Obtains an instance that uses the standard set of reference data.
-
-
-
Method Detail
-
standard
static TradeCsvInfoResolver standard()
Obtains an instance that uses the standard set of reference data.- Returns:
- the resolver
-
of
static TradeCsvInfoResolver of(ReferenceData refData)
Obtains an instance that uses the specified set of reference data.- Parameters:
refData- the reference data- Returns:
- the resolver
-
getReferenceData
ReferenceData getReferenceData()
Gets the reference data being used.- Returns:
- the reference data
-
parseStandardAttributes
default void parseStandardAttributes(CsvRow row, TradeInfoBuilder builder)
Parses standard attributes intoTradeInfo.This parses the standard set of attributes, which are the three constants in
AttributeType. The column names are 'Description', 'Name' and 'CCP'.- Parameters:
row- the CSV row to parsebuilder- the builder to update
-
parseTradeInfo
default void parseTradeInfo(CsvRow row, TradeInfoBuilder builder)
Parses attributes intoTradeInfo.If they are available, the trade ID, date, time and zone will have been set before this method is called. They may be altered if necessary, although this is not recommended.
- Parameters:
row- the CSV row to parsebuilder- the builder to update
-
completeTradeCommon
default <T extends Trade> T completeTradeCommon(CsvRow row, T trade)
Completes the trade, potentially parsing additional columns.This is called by each of the
completeTrademethods.- Type Parameters:
T- the trade type- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default FraTrade completeTrade(CsvRow row, FraTrade trade)
Completes the FRA trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default SecurityTrade completeTrade(CsvRow row, SecurityTrade trade)
Completes the trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default SwapTrade completeTrade(CsvRow row, SwapTrade trade)
Completes the Swap trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default SwaptionTrade completeTrade(CsvRow row, SwaptionTrade trade)
Completes the Swaption trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default BulletPaymentTrade completeTrade(CsvRow row, BulletPaymentTrade trade)
Completes the trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default TermDepositTrade completeTrade(CsvRow row, TermDepositTrade trade)
Completes the trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default FxSingleTrade completeTrade(CsvRow row, FxSingleTrade trade)
Completes the FX Forward trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default FxSwapTrade completeTrade(CsvRow row, FxSwapTrade trade)
Completes the FX Swap trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default FxVanillaOptionTrade completeTrade(CsvRow row, FxVanillaOptionTrade trade)
Completes the FX Vanilla Option trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default FxNdfTrade completeTrade(CsvRow row, FxNdfTrade trade)
Completes the FX NDF trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default CdsTrade completeTrade(CsvRow row, CdsTrade trade)
Completes the CDS trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default CdsIndexTrade completeTrade(CsvRow row, CdsIndexTrade trade)
Completes the CDS Index trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
completeTrade
default IborCapFloorTrade completeTrade(CsvRow row, IborCapFloorTrade trade)
Completes the CapFloor trade, potentially parsing additional columns.This is called after the trade has been parsed and after
parseTradeInfo(CsvRow, TradeInfoBuilder).By default this calls
completeTradeCommon(CsvRow, Trade).- Parameters:
row- the CSV row to parsetrade- the parsed trade- Returns:
- the updated trade
-
parseFraTrade
default FraTrade parseFraTrade(CsvRow row, TradeInfo info)
Parses a FRA trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the FRA trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseSecurityTrade
default SecurityQuantityTrade parseSecurityTrade(CsvRow row, TradeInfo info)
Parses a Security trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the Security trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseSwapTrade
default SwapTrade parseSwapTrade(CsvRow row, List<CsvRow> variableRows, TradeInfo info)
Parses a Swap trade from CSV.- Parameters:
row- the CSV row to parsevariableRows- the CSV rows representing variable notional/rate etcinfo- the trade info- Returns:
- the Swap trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseSwaptionTrade
default SwaptionTrade parseSwaptionTrade(CsvRow row, List<CsvRow> variableRows, TradeInfo info)
Parses a Swaption trade from CSV.- Parameters:
row- the CSV row to parsevariableRows- the CSV rows representing variable notional/rate etcinfo- the trade info- Returns:
- the Swaption trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseBulletPaymentTrade
default BulletPaymentTrade parseBulletPaymentTrade(CsvRow row, TradeInfo info)
Parses a Bullet Payment trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the Bullet Payment trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseTermDepositTrade
default TermDepositTrade parseTermDepositTrade(CsvRow row, TradeInfo info)
Parses a Term Deposit trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the Term Deposit trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseFxSingleTrade
default FxSingleTrade parseFxSingleTrade(CsvRow row, TradeInfo info)
Parses a FX Single trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the FX Single trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseFxSwapTrade
default FxSwapTrade parseFxSwapTrade(CsvRow row, TradeInfo info)
Parses a FX Swap trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the FX Swap trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseFxVanillaOptionTrade
default FxVanillaOptionTrade parseFxVanillaOptionTrade(CsvRow row, TradeInfo info)
Parses a FX Vanilla Option trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the FX Vanilla Option trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseFxNdfTrade
default FxNdfTrade parseFxNdfTrade(CsvRow row, TradeInfo info)
Parses a FX NDF trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the FX NDF trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseCdsTrade
default CdsTrade parseCdsTrade(CsvRow row, TradeInfo info)
Parses a CDS trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the CDS trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseCdsIndexTrade
default CdsIndexTrade parseCdsIndexTrade(CsvRow row, TradeInfo info)
Parses a CDS Index trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the CDS trade
- Throws:
RuntimeException- if the row contains invalid data
-
parseCapFloorTrade
default IborCapFloorTrade parseCapFloorTrade(CsvRow row, TradeInfo info)
Parses a CapFloor trade from CSV.- Parameters:
row- the CSV row to parseinfo- the trade info- Returns:
- the CapFloor trade
- Throws:
RuntimeException- if the row contains invalid data
-
overrideParseTrade
default Optional<Trade> overrideParseTrade(String typeUpper, CsvRow row, TradeInfo info)
Parses any kind of trade from CSV before standard matching.This is called before the standard matching on the 'Product Type' column. As such, it allows the standard parsing to be replaced for a given type.
- Parameters:
typeUpper- the upper case product type columnrow- the CSV row to parseinfo- the trade info- Returns:
- the trade, empty if the product type is not known, or if standard parsing should occur
- Throws:
RuntimeException- if the product type is known but the row contains invalid data
-
parseOtherTrade
default Optional<Trade> parseOtherTrade(String typeUpper, CsvRow row, TradeInfo info)
Parses any kind of trade from CSV after standard matching.This is called after the standard matching on the 'Product Type' column. As such, it allows non-matched rows to be captured.
- Parameters:
typeUpper- the upper case product type columnrow- the CSV row to parseinfo- the trade info- Returns:
- the trade, empty if the product type is not known
- Throws:
RuntimeException- if the product type is known but the row contains invalid data
-
-