Modifier and Type | Class and Description |
---|---|
class |
AbstractValidator<T>
Convenience base class for validators.
|
Modifier and Type | Method and Description |
---|---|
<T,R> Validator<T> |
ValidatorUtils.as(java.lang.Class<T> t,
Validator<R> v)
Will do the following:
Check if
t is equal to or assignable to this Validator's
model type. |
static <T,R> Validator<T> |
ValidatorUtils.cast(java.lang.Class<T> type,
Validator<R> other)
Get a validator for a validator of a possibly unknown type.
|
static <T> Validator<T> |
ValidatorUtils.limitSeverity(Severity maximum,
Validator<T>... validators)
Wrapper one or more validators in a validator which imposes a limit on
the severity of the validators in use.
|
static <T> Validator<T> |
ValidatorUtils.limitSeverity(Severity maximum,
Validator<T> validator)
Wraps a validator in a validator which imposes a limit on the severity of the validator in use.
|
static <T> Validator<T> |
ValidatorUtils.merge(Validator<T>... validators)
Merge together a chain of validators (all working which work against the same
type), using logical
AND . |
static <T> Validator<T> |
ValidatorUtils.merge(Validator<T> validator1,
Validator<T> validator2)
Merge together two validators (both of which work against the same type), using logical
AND . |
Modifier and Type | Method and Description |
---|---|
<T,R> Validator<T> |
ValidatorUtils.as(java.lang.Class<T> t,
Validator<R> v)
Will do the following:
Check if
t is equal to or assignable to this Validator's
model type. |
static <T,R> Validator<T> |
ValidatorUtils.cast(java.lang.Class<T> type,
Validator<R> other)
Get a validator for a validator of a possibly unknown type.
|
static <T> Validator<T> |
ValidatorUtils.limitSeverity(Severity maximum,
Validator<T>... validators)
Wrapper one or more validators in a validator which imposes a limit on
the severity of the validators in use.
|
static <T> Validator<T> |
ValidatorUtils.limitSeverity(Severity maximum,
Validator<T> validator)
Wraps a validator in a validator which imposes a limit on the severity of the validator in use.
|
static <T> Validator<T> |
ValidatorUtils.merge(Validator<T>... validators)
Merge together a chain of validators (all working which work against the same
type), using logical
AND . |
static <T> Validator<T> |
ValidatorUtils.merge(Validator<T> validator1,
Validator<T> validator2)
Merge together two validators (both of which work against the same type), using logical
AND . |
static <T> Validator<T> |
ValidatorUtils.merge(Validator<T> validator1,
Validator<T> validator2)
Merge together two validators (both of which work against the same type), using logical
AND . |
Modifier and Type | Class and Description |
---|---|
class |
IndexValidators
An enumeration of validator factories for commonly needed forms of
selection validaton.
|
Modifier and Type | Class and Description |
---|---|
class |
StringValidators
An enumeration of validator factories for commonly needed forms of
validation such as non-empty strings, valid file names and URLs and
so forth.
|
Modifier and Type | Method and Description |
---|---|
static Validator<java.lang.String> |
StringValidators.disallowChars(char[] chars)
Get a validator which fails if any of the characters in the
passed char array are contained in the evaluated text
|
static Validator<java.lang.String> |
StringValidators.encodableInCharset(java.lang.String charsetName)
Get a validator which determines if the passed string can be encoded
in the specified encoding.
|
static Validator<java.lang.String> |
StringValidators.forFormat(java.text.Format fmt)
Get a validator that uses a specific
Format (e.g. |
static Validator<java.lang.String> |
StringValidators.maxLength(int length)
Validator that enforces maximum input length
|
static Validator<java.lang.String> |
StringValidators.mayNotEndWith(char ch)
Create a validator which does not allow you to terminate a string
with a particular character
|
static Validator<java.lang.String> |
StringValidators.minLength(int length)
Validator that enforces minimum input length
|
static Validator<java.lang.String> |
StringValidators.numberRange(java.lang.Number min,
java.lang.Number max)
Get a validator that guarantees that a number is within a certain
range (inclusive)
|
static Validator<java.lang.String> |
StringValidators.regexp(java.lang.String regexp,
java.lang.String message,
boolean acceptPartialMatches)
Get a validator which fails if the text to validate does not match a
passed regular expression.
|
static Validator<java.lang.String> |
StringValidators.splitString(java.lang.String regexp,
Validator<java.lang.String>... validators)
Returns a validator which first splits the string to be evaluated according
to the passed regexp, then passes each component of the split string to
the passed validator.
|
static Validator<java.lang.String> |
StringValidators.splitString(java.lang.String regexp,
Validator<java.lang.String> validator)
Returns a validator which first splits the string to be evaluated according
to the passed regexp, then passes each component of the split string to
the passed validator.
|
Validator<java.lang.String> |
StringValidators.trim()
Returns a Validator
trim() on the String to be validated,
and then passes the resulting (trimmed) String to this instance of StringValidators . |
static Validator<java.lang.String> |
StringValidators.trimString(Validator<java.lang.String>... validators)
Creates a
Validator<String> that will first call trim() on the String to be validated,
and then passes the resulting (trimmed) String to the passed Validator<String> (or chain thereof). |
static Validator<java.lang.String> |
StringValidators.trimString(Validator<java.lang.String> validator)
Creates a
Validator<String> that will first call trim() on the String to be validated,
and then passes the resulting (trimmed) String to the passed Validator<String> . |
static Validator<java.lang.String> |
StringValidators.validNumber(java.util.Locale l)
Create a number validator that uses a specific locale.
|
Modifier and Type | Method and Description |
---|---|
static Validator<java.lang.String> |
StringValidators.splitString(java.lang.String regexp,
Validator<java.lang.String>... validators)
Returns a validator which first splits the string to be evaluated according
to the passed regexp, then passes each component of the split string to
the passed validator.
|
static Validator<java.lang.String> |
StringValidators.splitString(java.lang.String regexp,
Validator<java.lang.String> validator)
Returns a validator which first splits the string to be evaluated according
to the passed regexp, then passes each component of the split string to
the passed validator.
|
static Validator<java.lang.String> |
StringValidators.trimString(Validator<java.lang.String>... validators)
Creates a
Validator<String> that will first call trim() on the String to be validated,
and then passes the resulting (trimmed) String to the passed Validator<String> (or chain thereof). |
static Validator<java.lang.String> |
StringValidators.trimString(Validator<java.lang.String> validator)
Creates a
Validator<String> that will first call trim() on the String to be validated,
and then passes the resulting (trimmed) String to the passed Validator<String> . |
Modifier and Type | Method and Description |
---|---|
Validator<To> |
Converter.convert(Validator<From>... froms)
Will merge the chain of passed validators to one, and then convert it to
the requested type.
|
abstract Validator<To> |
Converter.convert(Validator<From> from)
|
Modifier and Type | Method and Description |
---|---|
Validator<To> |
Converter.convert(Validator<From>... froms)
Will merge the chain of passed validators to one, and then convert it to
the requested type.
|
abstract Validator<To> |
Converter.convert(Validator<From> from)
|
Modifier and Type | Method and Description |
---|---|
<ComponentType,ValueType> |
ValidationGroup.add(ComponentType comp,
Validator<ValueType>... validators) |
<ComponentType,ValueType> |
ValidationGroup.add(ComponentType comp,
Validator<ValueType> validator) |
protected abstract ValidationListener<CompType> |
ValidationListenerFactory.createListener(CompType component,
ValidationStrategy strategy,
ValidationUI validationUI,
Validator<ModelType> validator) |
static <CType,MType> |
ValidationListenerFactory.createValidationListener(CType component,
ValidationStrategy strategy,
ValidationUI validationUI,
Validator<MType> validator)
Create a ValidationListener for a specific type of component, which accepts
Validators of a given type.
|
Modifier and Type | Method and Description |
---|---|
void |
SwingValidationGroup.add(javax.swing.AbstractButton[] buttons,
Validator<java.lang.Integer[]>... validators)
Add a validator of button models - typically to see if any are selected.
|
void |
SwingValidationGroup.add(javax.swing.AbstractButton[] buttons,
Validator<java.lang.Integer[]> validator)
Add a validator of button models - typically to see if any are selected.
|
void |
SwingValidationGroup.add(javax.swing.JComboBox box,
Validator<java.lang.String>... validators)
Add a combo box to be validated using the passed validators
|
void |
SwingValidationGroup.add(javax.swing.JComboBox box,
Validator<java.lang.String> validator)
Add a combo box to be validated using the passed validator.
|
void |
SwingValidationGroup.add(javax.swing.JList list,
Validator<java.lang.Integer[]>... validators)
Add a JList to be validated using the passed validators
|
void |
SwingValidationGroup.add(javax.swing.JList list,
Validator<java.lang.Integer[]> validator)
Add a JList to be validated using the passed validator.
|
void |
SwingValidationGroup.add(javax.swing.text.JTextComponent comp,
Validator<java.lang.String>... validators)
Add a text component to be validated using the passed validators.
|
void |
SwingValidationGroup.add(javax.swing.text.JTextComponent comp,
Validator<java.lang.String> validator)
Add a text component to be validated using the passed validator.
|
Constructor and Description |
---|
AbstractValidationListener(java.lang.Class<CompType> type,
CompType comp,
ValidationUI ui,
Validator<T> validator)
Create a new AbstractValidationListener for the single component
passed here as an argument.
|