public interface OptionDefinition
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCategory()
May return a category for this option, which may help some GUI to group options.
|
java.lang.String |
getDefaultValue()
Returns a default value for this option.
|
java.util.List<DependentOption> |
getDependentOptions()
Returns a list of options that need to be present - and optionally of some special value - for this option to be applicable
|
java.lang.String |
getDescription(java.util.Locale locale)
Returns a - maybe localized - description for this option
|
java.lang.String |
getName()
Returns the name of the option, which is used as key on option maps
|
OptionType |
getOptionType()
Returns the type of this option which determines the values that are accepted and the data type in which it is used
|
java.lang.Class<? extends ReferenceType> |
getReferenceType()
Returns a reference type if values of this option represent references to well known resources in WGA, or null if they don't
|
java.lang.String |
getTitle(java.util.Locale locale)
Returns a - maybe localized - title for this option
|
boolean |
hasFlag(java.lang.String flagName)
Returns if an option has a special flag, which may cause it to be specially treated by some functionalities
|
boolean |
isEmptyAllowed()
Returns if the option maybe empty.
|
boolean |
isExpert()
Returns if this option is an "expert option" which only should be offered in "expert mode"
|
boolean |
isOptional()
Returns if this option is "optional" i.e. it can be omitted from module options
|
void |
validate(java.lang.String value,
java.util.Locale locale,
ValidationContext cx)
Validates the given value against the option definition
Implementations are obliged to pass the call to method
OptionType.validate(String, Locale, ValidationContext) of their OptionType internally |
java.lang.String getName()
boolean isOptional()
boolean isExpert()
java.lang.String getDescription(java.util.Locale locale)
OptionType getOptionType()
java.lang.String getDefaultValue()
java.lang.String getTitle(java.util.Locale locale)
java.lang.String getCategory()
OptionCategoryDefinition
containing further information. Return null if no category applies.java.util.List<DependentOption> getDependentOptions()
void validate(java.lang.String value, java.util.Locale locale, ValidationContext cx) throws OptionValueValidationException
OptionType.validate(String, Locale, ValidationContext)
of their OptionType
internallyvalue
- The value to validatelocale
- A locale which is used to choose the right language of validation error messagecx
- A validation contextOptionValueValidationException
boolean isEmptyAllowed()
OptionType.isEmptyAllowed()
if the option definition itself does not enforce emptiness allowanceboolean hasFlag(java.lang.String flagName)
java.lang.Class<? extends ReferenceType> getReferenceType()