Interface LightweightPositionCsvInfoResolver
-
- All Superinterfaces:
PositionCsvInfoResolver
public interface LightweightPositionCsvInfoResolver extends PositionCsvInfoResolver
Resolves additional information when parsing position 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. It also allows the ETD contract specification to be loaded.
This extension to
PositionCsvInfoResolver
parses positions without the need for reference data. When an ETD row is found,EtdIdUtils
is used to create an identifier. This resolver must always return an instance ofSecurityPosition
from the parsing methods.
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static LightweightPositionCsvInfoResolver
of(ReferenceData refData)
Obtains an instance that uses the specified set of reference data.default Position
parseEtdFuturePosition(CsvRow row, PositionInfo info)
Parses an ETD future position from the CSV row.default Position
parseEtdOptionPosition(CsvRow row, PositionInfo info)
Parses an ETD future position from the CSV row.default Position
parseNonEtdPosition(CsvRow row, PositionInfo info)
Parses a non-ETD position from the CSV row.static LightweightPositionCsvInfoResolver
standard()
Obtains an instance that uses the standard set of reference data.-
Methods inherited from interface com.opengamma.strata.loader.csv.PositionCsvInfoResolver
completePosition, completePosition, completePosition, getReferenceData, parseEtdContractSpec, parseEtdFutureSecurityPosition, parseEtdOptionSecurityPosition, parseNonEtdSecurityPosition, parsePositionInfo, parseStandardAttributes
-
-
-
-
Method Detail
-
standard
static LightweightPositionCsvInfoResolver standard()
Obtains an instance that uses the standard set of reference data.- Returns:
- the resolver
-
of
static LightweightPositionCsvInfoResolver of(ReferenceData refData)
Obtains an instance that uses the specified set of reference data.- Parameters:
refData
- the reference data- Returns:
- the resolver
-
parseNonEtdPosition
default Position parseNonEtdPosition(CsvRow row, PositionInfo info)
Description copied from interface:PositionCsvInfoResolver
Parses a non-ETD position from the CSV row.This parses the basic
SecurityPosition
and then tries to parse the extra details to convert it into aGenericSecurityPosition
.- Specified by:
parseNonEtdPosition
in interfacePositionCsvInfoResolver
- Parameters:
row
- the CSV row to parseinfo
- the position information- Returns:
- the parsed position
-
parseEtdFuturePosition
default Position parseEtdFuturePosition(CsvRow row, PositionInfo info)
Description copied from interface:PositionCsvInfoResolver
Parses an ETD future position from the CSV row.This is intended to use reference data to find the ETD future security, returning it as an instance of
EtdFuturePosition
. The reference data lookup usesPositionCsvInfoResolver.parseEtdContractSpec(CsvRow, EtdType)
by default, however it could be overridden to lookup the security directly in reference data.- Specified by:
parseEtdFuturePosition
in interfacePositionCsvInfoResolver
- Parameters:
row
- the CSV row to parseinfo
- the position information- Returns:
- the parsed position
-
parseEtdOptionPosition
default Position parseEtdOptionPosition(CsvRow row, PositionInfo info)
Description copied from interface:PositionCsvInfoResolver
Parses an ETD future position from the CSV row.This is intended to use reference data to find the ETD future security, returning it as an instance of
EtdOptionPosition
. The reference data lookup usesPositionCsvInfoResolver.parseEtdContractSpec(CsvRow, EtdType)
by default, however it could be overridden to lookup the security directly in reference data.- Specified by:
parseEtdOptionPosition
in interfacePositionCsvInfoResolver
- Parameters:
row
- the CSV rowinfo
- the position info- Returns:
- the parsed position
-
-