public class PredefinedValuesOptionType extends StringOptionType
addValue(String)
. Pass a bundle loader to the constructor which serves titles for the values.
Look class LocalizedOptionValueProvider
- which is internally used by this type - which label names are expected to be served by the bundle loader that is given to this class.INSTANCE
Constructor and Description |
---|
PredefinedValuesOptionType() |
PredefinedValuesOptionType(LocalisationBundleLoader loader,
java.lang.String optionName) |
Modifier and Type | Method and Description |
---|---|
void |
addValue(java.lang.String value) |
void |
addValue(java.lang.String value,
java.lang.String title)
Add a value to be offered by this option type
|
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 |
isRestricted()
If the type has a value provider: Determines if the option values are restricted to the values returned by it.
|
void |
setEmptyAllowed(boolean emptyAllowed) |
void |
setRestricted(boolean restricted)
Sets if this option type is restricted
|
void |
validate(java.lang.String value,
java.util.Locale locale,
WGAConfiguration config) |
getDataTypeHint, isMultiValue, validate
public PredefinedValuesOptionType(LocalisationBundleLoader loader, java.lang.String optionName)
loader
- An bundle loader to load localized informationoptionName
- A name that is used to lookup value titles from the bundle loaderpublic PredefinedValuesOptionType()
public void addValue(java.lang.String value, java.lang.String title)
value
- public void addValue(java.lang.String value)
public OptionValueProvider getValueProvider(WGAConfiguration configCopy)
OptionType
getValueProvider
in interface OptionType
getValueProvider
in class StringOptionType
configCopy
- If the current functionality involves the WGA configuration it may pass over the current working copy of it so the provider may use itpublic boolean isRestricted()
OptionType
isRestricted
in interface OptionType
isRestricted
in class StringOptionType
public void validate(java.lang.String value, java.util.Locale locale, WGAConfiguration config) throws OptionValueValidationException
OptionValueValidationException
public void setRestricted(boolean restricted)
public boolean isEmptyAllowed()
OptionType
isEmptyAllowed
in interface OptionType
isEmptyAllowed
in class StringOptionType
public void setEmptyAllowed(boolean emptyAllowed)