Package com.opengamma.strata.loader.csv
Interface PositionCsvParserPlugin
-
- All Superinterfaces:
Named
public interface PositionCsvParserPlugin extends Named
Pluggable CSV position parser.Implementations of this interface parse a CSV file.
See
PositionCsvLoader
for the main entry point to parsing.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ExtendedEnum<PositionCsvParserPlugin>
extendedEnum()
Gets the extended enum helper.String
getName()
Gets the name that uniquely identifies this parser.static PositionCsvParserPlugin
of(String uniqueName)
Obtains an instance from the specified unique name.Optional<Position>
parsePosition(Class<?> requiredJavaType, CsvRow row, PositionInfo info, PositionCsvInfoResolver resolver)
Parses a single CSV format position from the input.Set<String>
positionTypeNames()
Returns the upper-case product types that this plugin supports.
-
-
-
Method Detail
-
of
static PositionCsvParserPlugin of(String uniqueName)
Obtains an instance from the specified unique name.- Parameters:
uniqueName
- the unique name- Returns:
- the parser
- Throws:
IllegalArgumentException
- if the name is not known
-
extendedEnum
static ExtendedEnum<PositionCsvParserPlugin> extendedEnum()
Gets the extended enum helper.This helper allows instances of the parser to be looked up. It also provides the complete set of available instances.
- Returns:
- the extended enum helper
-
positionTypeNames
Set<String> positionTypeNames()
Returns the upper-case product types that this plugin supports.These are matched against the CSV file type column.
- Returns:
- the types that this plugin supports
-
parsePosition
Optional<Position> parsePosition(Class<?> requiredJavaType, CsvRow row, PositionInfo info, PositionCsvInfoResolver resolver)
Parses a single CSV format position from the input.This parses a single position from the CSV rows provided. The position may exist on multiple rows
- Parameters:
requiredJavaType
- the Java type to returnrow
- the row to parseinfo
- the position inforesolver
- the resolver- Returns:
- the position object, empty if choosing not to parse because the Java type does not match
- Throws:
RuntimeException
- if unable to parse
-
getName
String getName()
Gets the name that uniquely identifies this parser.The name should typically be the name of the
Product
that can be parsed.This name is used in serialization and can be parsed using
of(String)
.
-
-