Class PlainSwapEditorHandler
java.lang.Object
net.finmath.smartcontract.product.xml.PlainSwapEditorHandler
Class that handles incoming requests for generating and interacting with plain swaps descriptors coming from the editor.
The API exposed by this class is not definitive and may be subject to changes without notice.
- Version:
- alpha.1
- Author:
- Luca Bressan
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Enumeration of possible choices for the swap legs. -
Constructor Summary
ConstructorDescriptionPlainSwapEditorHandler
(PlainSwapOperationRequest plainSwapOperationRequest, String templatePath, String schemaPath) Returns the plain swap editor handler. -
Method Summary
Modifier and TypeMethodDescriptionGetter method for the JAXB representation of the contractReturns the SDCmL string associated with this plain swap handler.getSchedule
(PlainSwapEditorHandler.LegSelector legSelector, String marketData) Returns a list of cashflow periods representing the payment streams involved in the plain swap described.getSchedule
(PlainSwapEditorHandler.LegSelector legSelector, MarketDataSet marketData) Returns a list of cashflow periods representing the payment streams involved in the plain swap described.
-
Constructor Details
-
PlainSwapEditorHandler
public PlainSwapEditorHandler(PlainSwapOperationRequest plainSwapOperationRequest, String templatePath, String schemaPath) throws IOException, SAXException, jakarta.xml.bind.JAXBException, DatatypeConfigurationException Returns the plain swap editor handler.- Parameters:
plainSwapOperationRequest
- the JSON request that contains the editor info.templatePath
- path for the SDCmL template XML to be usedschemaPath
- path for the SDCmL validation schema- Throws:
IOException
- when loading settings files fails.SAXException
- when validation of the generated contract fails.jakarta.xml.bind.JAXBException
- when marshalling/unmarshalling of a SDCmL object/file fails.DatatypeConfigurationException
- when conversion of dates to the FPmL specifications fails.
-
-
Method Details
-
getContractAsXmlString
public String getContractAsXmlString() throws IOException, SAXException, jakarta.xml.bind.JAXBExceptionReturns the SDCmL string associated with this plain swap handler.- Returns:
- the SDCmL document
- Throws:
IOException
- when the conversion of the stream to string fails.SAXException
- when the marshalled XML file does not validate against the schema.jakarta.xml.bind.JAXBException
- when the marshalling of the XML fails.
-
getContract
Getter method for the JAXB representation of the contract- Returns:
- the contract object
-
getSchedule
public List<CashflowPeriod> getSchedule(PlainSwapEditorHandler.LegSelector legSelector, String marketData) throws IOException, CloneNotSupportedException Returns a list of cashflow periods representing the payment streams involved in the plain swap described.- Parameters:
legSelector
- the leg for which the schedule should be calculated.marketData
- the market data used for calibration of the model used for the payments' calculation.- Returns:
- the payment schedule.
- Throws:
IOException
CloneNotSupportedException
-
getSchedule
public List<CashflowPeriod> getSchedule(PlainSwapEditorHandler.LegSelector legSelector, MarketDataSet marketData) throws IOException, CloneNotSupportedException Returns a list of cashflow periods representing the payment streams involved in the plain swap described.- Parameters:
legSelector
- the leg for which the schedule should be calculated.marketData
- the market data used for calibration of the model used for the payments' calculation.- Returns:
- the payment schedule.
- Throws:
IOException
CloneNotSupportedException
-