public class ValidationOptions
extends java.lang.Object
GenericOverview.getValidationOptions()
,
Failure
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,java.lang.String> |
options
Other options.
|
private java.util.Map<java.lang.String,Severity> |
severities
Maps Validator ID to severity.
|
Constructor and Description |
---|
ValidationOptions()
Create a new ValidationOptions object.
|
ValidationOptions(Presets.Preset preset)
Create a new ValidationOptions object and load settings from a
preset.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getOption(ValidationRuleAction rule,
java.lang.String key,
java.lang.String defaultValue)
Get the configured option for a validator rule.
|
java.lang.String |
getOption(Validator validator,
java.lang.String key,
java.lang.String defaultValue)
Deprecated.
In 3.2, use
getOption(ValidationRuleAction, String, String) instead |
Severity |
getSeverity(ValidationRuleAction rule)
Get the severity level for the specified validator rule.
|
Severity |
getSeverity(Validator validator)
Deprecated.
In 3.2, use
getSeverity(ValidationRuleAction) instead |
void |
loadFromPreset(Presets.Preset preset,
boolean clearFirst)
Load validation options from a
Presets.Preset . |
void |
saveToPreset(Presets.Preset preset)
Save the current settings to a preset.
|
void |
setOption(ValidationRuleAction rule,
java.lang.String key,
java.lang.String value)
Set an option for a validator rule.
|
void |
setOption(Validator validator,
java.lang.String key,
java.lang.String value)
Deprecated.
In 3.2, use
setOption(ValidationRuleAction, String, String) instead |
void |
setSeverity(ValidationRuleAction rule,
Severity severity)
Set a severity level for the specified validation rule.
|
void |
setSeverity(Validator validator,
Severity severity)
Deprecated.
In 3.2, use
setSeverity(ValidationRuleAction, Severity) instead |
private java.util.Map<java.lang.String,Severity> severities
private java.util.Map<java.lang.String,java.lang.String> options
public ValidationOptions()
public ValidationOptions(Presets.Preset preset)
preset
- The preset to load settings from, or null to not
load any settings@Deprecated public Severity getSeverity(Validator validator)
getSeverity(ValidationRuleAction)
insteadpublic Severity getSeverity(ValidationRuleAction rule)
rule
- The validation rule to get the severity level forValidator.getDefaultSeverity()
@Deprecated public void setSeverity(Validator validator, Severity severity)
setSeverity(ValidationRuleAction, Severity)
insteadpublic void setSeverity(ValidationRuleAction rule, Severity severity)
rule
- The validation ruleseverity
- The severity level or null to use the default severity level@Deprecated public java.lang.String getOption(Validator validator, java.lang.String key, java.lang.String defaultValue)
getOption(ValidationRuleAction, String, String)
insteadpublic java.lang.String getOption(ValidationRuleAction rule, java.lang.String key, java.lang.String defaultValue)
rule
- The validation rulekey
- The key (name) of the optiondefaultValue
- The default value in case there is no configured value@Deprecated public void setOption(Validator validator, java.lang.String key, java.lang.String value)
setOption(ValidationRuleAction, String, String)
insteadpublic void setOption(ValidationRuleAction rule, java.lang.String key, java.lang.String value)
rule
- The validation rulekey
- The key (name) of the optionvalue
- The value to set or null to remove the valuepublic void loadFromPreset(Presets.Preset preset, boolean clearFirst)
Presets.Preset
. The preset
should contain settings where the ID of the a Validator
is used as keys and the names of Severity
values are used
as values.preset
- The preset to load the options fromclearFirst
- If the current settings should be cleared
before the new ones are loaded from the presetsaveToPreset(net.sf.basedb.core.Presets.Preset)
public void saveToPreset(Presets.Preset preset)
Validator.getId()
is used as key and the Enum.name()
is used as value.preset
- The preset to save the settings to