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 Detail

      • 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 return
        row - the row to parse
        info - the position info
        resolver - 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).

        Specified by:
        getName in interface Named
        Returns:
        the unique name