Interface FpmlTradeInfoParserPlugin

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface FpmlTradeInfoParserPlugin
    Pluggable FpML trade information parser.

    Implementations of this interface parse FpML to produce TradeInfo. The FpmlDocument instance provides many useful helper methods.

    See FpmlDocumentParser for the main entry point for FpML parsing.

    • Method Detail

      • standard

        static FpmlTradeInfoParserPlugin standard()
        Returns the standard parser plugin that parses the trade date and the first identifier of "our" party.
        Returns:
        the standard trade info parser
      • parseTrade

        TradeInfoBuilder parseTrade​(FpmlDocument document,
                                    java.time.LocalDate tradeDate,
                                    com.google.common.collect.ListMultimap<java.lang.String,​StandardId> allTradeIds)
        Parses trade information from the FpML document.

        This parses any trade info that is desired from the specified FpML document. Details of the whole document and parser helper methods are provided. Typically such parsing will require accessing the <tradeHeader> element from the root FpML element in the document.

        Since most implementations will need the trade date and a trade identifier, these are pre-parsed before the method is invoked. The parties associated with the party href id can be obtained from the document.

        A new instance of the builder must be returned each time the method is invoked. The builder is returned to allow the counterparty to be added by the FpmlParserPlugin implementation based on the trade direction.

        Parameters:
        tradeDate - the trade date from the document
        allTradeIds - the collection of trade identifiers in the document, keyed by party href id
        document - the document-wide information and parser helper
        Returns:
        the trade info object
        Throws:
        java.lang.RuntimeException - if unable to parse