public interface OptionType
OptionValueProvider
via getValueProvider(WGAConfiguration)
, which offers these allowed values.
Finally an option type may define a validation method which validates if a given value is valid for options of this type.Modifier and Type | Method and Description |
---|---|
java.lang.Class<? extends java.lang.Object> |
getDataTypeHint()
Returns the data type which values of this option type actually represent.
|
OptionValueProvider |
getValueProvider(WGAConfiguration configCopy)
May return an option provider that provides allowed values for options of this type
|
boolean |
isEmptyAllowed()
Returns if the option maybe empty.
|
boolean |
isMultiValue()
Returns if the option type may return/receive multiple values.
|
boolean |
isRestricted()
If the type has a value provider: Determines if the option values are restricted to the values returned by it.
|
void |
validate(java.lang.String value,
java.util.Locale locale,
ValidationContext cx)
Validates the given value for this option type.
|
java.lang.Class<? extends java.lang.Object> getDataTypeHint()
OptionValueProvider getValueProvider(WGAConfiguration configCopy)
configCopy
- If the current functionality involves the WGA configuration it may pass over the current working copy of it so the provider may use itboolean isRestricted()
void validate(java.lang.String value, java.util.Locale locale, ValidationContext cx) throws OptionValueValidationException
OptionValueValidationException
if validation failesvalue
- The value to be validatedlocale
- A locale that may be used to give back an error message in the thrown validation exceptioncx
- Context information for the validationOptionValueValidationException
- if validation failsboolean isEmptyAllowed()
boolean isMultiValue()
List
of the data type given in getDataTypeHint()
when it is read and converted.