Interface FpmlParserPlugin
-
- All Superinterfaces:
Named
public interface FpmlParserPlugin extends Named
Pluggable FpML trade parser.Implementations of this interface parse an FpML trade element, including any trade header. The
FpmlDocument
instance provides many useful helper methods.See
FpmlDocumentParser
for the main entry point for FpML parsing.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ExtendedEnum<FpmlParserPlugin>
extendedEnum()
Gets the extended enum helper.String
getName()
Gets the name that uniquely identifies this parser.static FpmlParserPlugin
of(String uniqueName)
Obtains an instance from the specified unique name.Trade
parseTrade(FpmlDocument document, XmlElement tradeEl)
Parses a single FpML format trade.
-
-
-
Method Detail
-
of
static FpmlParserPlugin 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<FpmlParserPlugin> 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
-
parseTrade
Trade parseTrade(FpmlDocument document, XmlElement tradeEl)
Parses a single FpML format trade.This parses a trade from the given XML element. Details of the whole document and parser helper methods are provided.
It is intended that this method is only called when the specified trade element contains a child element of the correct type for this parser.
- Parameters:
document
- the document-wide information and parser helpertradeEl
- the trade element to parse- Returns:
- the trade object
- Throws:
RuntimeException
- if unable to parse
-
getName
String getName()
Gets the name that uniquely identifies this parser.The name must be the name of the product element in FpML that is to be parsed. For example, 'fra', 'swap' or 'fxSingleLeg'.
This name is used in serialization and can be parsed using
of(String)
.
-
-