T - type of the controls valuepublic interface Validator<T> extends java.util.function.BiFunction<javafx.scene.control.Control,T,ValidationResult>
BiFunction which when given the control and its current value
computes the validation result| Modifier and Type | Method and Description |
|---|---|
static <T> Validator<T> |
combine(Validator<T>... validators)
Combines the given validators into a single Validator instance.
|
static <T> Validator<T> |
createEmptyValidator(java.lang.String message)
Factory method to create a validator, which checks if value exists.
|
static <T> Validator<T> |
createEmptyValidator(java.lang.String message,
Severity severity)
Factory method to create a validator, which checks if value exists.
|
static <T> Validator<T> |
createEqualsValidator(java.lang.String message,
java.util.Collection<T> values)
Factory method to create a validator, which checks if value exists in the provided collection.
|
static <T> Validator<T> |
createEqualsValidator(java.lang.String message,
Severity severity,
java.util.Collection<T> values)
Factory method to create a validator, which if value exists in the provided collection.
|
static <T> Validator<T> |
createPredicateValidator(java.util.function.Predicate<T> predicate,
java.lang.String message)
Factory method to create a validator, which evaluates the value validity with a given predicate.
|
static <T> Validator<T> |
createPredicateValidator(java.util.function.Predicate<T> predicate,
java.lang.String message,
Severity severity)
Factory method to create a validator, which evaluates the value validity with a given predicate.
|
static Validator<java.lang.String> |
createRegexValidator(java.lang.String message,
java.util.regex.Pattern regex,
Severity severity)
Factory method to create a validator, which checks the value against a given regular expression.
|
static Validator<java.lang.String> |
createRegexValidator(java.lang.String message,
java.lang.String regex,
Severity severity)
Factory method to create a validator, which checks the value against a given regular expression.
|
@SafeVarargs static <T> Validator<T> combine(Validator<T>... validators)
validators - the validators to combinestatic <T> Validator<T> createEmptyValidator(java.lang.String message, Severity severity)
message - text of a message to be created if value is invalidseverity - severity of a message to be created if value is invalidstatic <T> Validator<T> createEmptyValidator(java.lang.String message)
message - of a error to be created if value is invalidstatic <T> Validator<T> createEqualsValidator(java.lang.String message, Severity severity, java.util.Collection<T> values)
values - text of a message to be created if value is not foundseverity - severity of a message to be created if value is foundstatic <T> Validator<T> createEqualsValidator(java.lang.String message, java.util.Collection<T> values)
message - text of a error to be created if value is not foundvalues - static <T> Validator<T> createPredicateValidator(java.util.function.Predicate<T> predicate, java.lang.String message)
false.message - text of a message to be created if value is invalidpredicate - the predicate to be used for the value validity evaluation.static <T> Validator<T> createPredicateValidator(java.util.function.Predicate<T> predicate, java.lang.String message, Severity severity)
false.message - text of a message to be created if value is invalidpredicate - the predicate to be used for the value validity evaluation.severity - severity of a message to be created if value is invalidstatic Validator<java.lang.String> createRegexValidator(java.lang.String message, java.lang.String regex, Severity severity)
null or the value does not match the pattern.message - text of a message to be created if value is invalidregex - the regular expression the value has to matchseverity - severity of a message to be created if value is invalidstatic Validator<java.lang.String> createRegexValidator(java.lang.String message, java.util.regex.Pattern regex, Severity severity)
null or the value does not match the pattern.message - text of a message to be created if value is invalidregex - the regular expression the value has to matchseverity - severity of a message to be created if value is invalid