public abstract class ConfigurationOption extends Object implements Comparable<ConfigurationOption>
Modifier and Type | Field and Description |
---|---|
protected ConfigItem |
configItem |
protected List<Value> |
values |
Constructor and Description |
---|
ConfigurationOption(ConfigItem configItem,
Category category,
ConfigOptionRegistry configOptionRegistry)
Load validators and on configuration changed listeners.
|
Modifier and Type | Method and Description |
---|---|
void |
addExternalListener(OnConfigurationChangedListener listener) |
void |
addListener(OnConfigurationChangedListener listener) |
void |
addValidator(String key,
ConfigurationValidator validator) |
void |
checkDependencies()
If the configuration option has dependencies then this method checks all
configuration options on which this configuration option depends and if
they are valid then this configuration option will be activated.
|
int |
compareTo(ConfigurationOption o) |
void |
doDeepValidation()
Executes the validators and if an error accrues the ValidationException
will be thrown.
|
Category |
getCategory() |
ConfigOption |
getConfigOption() |
String |
getDescription() |
String |
getId() |
String |
getLabel() |
int |
getOrder() |
String |
getValue() |
List<Value> |
getValues() |
int |
getValuesCount() |
boolean |
hasValue() |
boolean |
isActive() |
boolean |
isRequired() |
boolean |
isValid()
The configuration option is valid if all validators valid and if it is
required it also needs a value.
|
void |
removeExternalListener(OnConfigurationChangedListener listener) |
void |
removeListener(OnConfigurationChangedListener listener) |
void |
removeValidator(ConfigurationValidator validator) |
void |
setCardinality(Cardinality cardinality) |
void |
setIsActive(boolean active) |
void |
setValue(List<Value> configValues)
Set value for multiple selection.
|
void |
setValue(Value value)
Set the value, execute validators and update the listeners.
|
protected void |
updateExternalListeners() |
protected void |
updateListeners() |
void |
updateValidatorAttributesForId(String name,
String[] attributes) |
protected ConfigItem configItem
public ConfigurationOption(ConfigItem configItem, Category category, ConfigOptionRegistry configOptionRegistry)
configItem
- category
- configOptionRegistry
- public void setValue(Value value) throws ValidationException
value
- ValidationException
public void setValue(List<Value> configValues) throws ValidationException
configValues
- ValidationException
public String getValue()
public int getValuesCount()
public void doDeepValidation() throws ValidationException
ValidationException
public void addListener(OnConfigurationChangedListener listener)
public void addExternalListener(OnConfigurationChangedListener listener)
public boolean isActive()
public boolean isRequired()
public String getId()
public boolean isValid()
public boolean hasValue()
public Category getCategory()
public void setCardinality(Cardinality cardinality)
public ConfigOption getConfigOption()
public void addValidator(String key, ConfigurationValidator validator)
protected void updateListeners()
protected void updateExternalListeners()
public void checkDependencies()
public int getOrder()
public String getDescription()
public String getLabel()
public int compareTo(ConfigurationOption o)
compareTo
in interface Comparable<ConfigurationOption>
public void removeListener(OnConfigurationChangedListener listener)
public void setIsActive(boolean active)
public void removeValidator(ConfigurationValidator validator)
public void updateValidatorAttributesForId(String name, String[] attributes)
public void removeExternalListener(OnConfigurationChangedListener listener)
Copyright © 2018 universAAL Consortium. All rights reserved.