switch (defn.getListedFutureOptionType()) {
case EQUITY_INDEX_FUTURE_OPTION:
return new EquityIndexFutureOptionSecurity(exchange, expiry, exerciseType, underlyingId, pointValue,
isMargined, currency, strike, optionType);
case EQUITY_DIVIDEND_FUTURE_OPTION:
return new EquityIndexDividendFutureOptionSecurity(exchange, expiry, exerciseType, underlyingId, pointValue,
isMargined, currency, strike, optionType);
default:
// The xml validation should prevent this from happening
throw new PortfolioParsingException("Unrecognised listed option type: " + defn.getListedFutureOptionType());
}