public class OptionValidationHandler extends InstrumentValidationHandler<Option>
The option expiry date is validated by validateExpiry(String).
SELECTOR| Constructor and Description |
|---|
OptionValidationHandler()
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
validate(Instrument instrument)
Validates the supplied instrument.
|
static void |
validateExpiry(String inExpiry)
Validates expiry field of an instrument.
|
static void |
validateExpiryDate(String inExpiry)
Validates that the date matches the expected pattern per
validateExpiry(String) and is a correct date for the given
month, year and day/week combination. |
public void validate(Instrument instrument) throws OrderValidationException
InstrumentValidationHandlervalidate in class InstrumentValidationHandler<Option>instrument - the instrumentOrderValidationException - if the validation fails.public static void validateExpiry(String inExpiry) throws OrderValidationException
Verifies that the expiry field has either of the following formats
inExpiry - the expiry field of the optionOrderValidationException - if the expiry field failed validation.public static void validateExpiryDate(String inExpiry) throws OrderValidationException
validateExpiry(String) and is a correct date for the given
month, year and day/week combination.
Note that this method is only available for convenience for UI validation. This method is not invoked for validation when the client is sending orders.
inExpiry - the expiry field of the optionOrderValidationException - if the expiry field failed validation.Copyright © 2015. All Rights Reserved.