public class Validator
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Validator.Report
A validation report
|
static class |
Validator.ReportBuilder
Builder for
Validator.Report |
Constructor and Description |
---|
Validator() |
Modifier and Type | Method and Description |
---|---|
static Validator.ReportBuilder |
buildReport() |
static java.util.Map<java.lang.String,java.lang.String> |
demapProperties(java.util.Map<java.lang.String,java.lang.String> input,
Description desc)
Reverses a set of properties mapped using the description's configuration to property mapping, or the same input
if the description has no mapping
|
static Validator.Report |
errorReport(java.lang.String key,
java.lang.String message)
Return a report for a single error item
|
static java.util.Map<java.lang.String,java.lang.String> |
mapProperties(java.util.Map<java.lang.String,java.lang.String> input,
Description desc)
Converts a set of input configuration keys using the description's configuration to property mapping, or the same
input if the description has no mapping
|
static Validator.Report |
validate(java.util.Properties props,
Description desc)
Validate a set of properties for a description, and return a report.
|
static Validator.Report |
validate(PropertyResolver resolver,
Description description,
PropertyScope defaultScope)
Validate a set of properties for a description, and return a report.
|
static Validator.Report |
validate(PropertyResolver resolver,
Description description,
PropertyScope defaultScope,
PropertyScope ignoredScope)
Validate a set of properties for a description, and return a report.
|
static Validator.Report |
validateProperties(PropertyResolver resolver,
java.util.List<Property> properties,
PropertyScope defaultScope,
PropertyScope ignoredScope)
Validate a set of properties for a description, and return a report.
|
public static Validator.Report errorReport(java.lang.String key, java.lang.String message)
key
- keymessage
- messagepublic static Validator.ReportBuilder buildReport()
public static Validator.Report validate(java.util.Properties props, Description desc)
props
- the input propertiesdesc
- the configuration descriptionpublic static Validator.Report validate(PropertyResolver resolver, Description description, PropertyScope defaultScope)
resolver
- property resolverdescription
- descriptiondefaultScope
- default scope for propertiespublic static Validator.Report validate(PropertyResolver resolver, Description description, PropertyScope defaultScope, PropertyScope ignoredScope)
resolver
- property resolverdescription
- descriptiondefaultScope
- default scope for propertiesignoredScope
- ignore properties at or below this scope, or null to ignore nonepublic static Validator.Report validateProperties(PropertyResolver resolver, java.util.List<Property> properties, PropertyScope defaultScope, PropertyScope ignoredScope)
resolver
- property resolverproperties
- list of propertiesdefaultScope
- default scope for propertiesignoredScope
- ignore properties at or below this scope, or null to ignore nonepublic static java.util.Map<java.lang.String,java.lang.String> mapProperties(java.util.Map<java.lang.String,java.lang.String> input, Description desc)
input
- input mapdesc
- plugin descriptionpublic static java.util.Map<java.lang.String,java.lang.String> demapProperties(java.util.Map<java.lang.String,java.lang.String> input, Description desc)
input
- input mapdesc
- plugin description