V
- the generic type of the values
in the collection.public class ValidatorMapValues<V> extends AbstractValidator<Map<?,V>> implements ComposedValueValidator<Map<?,V>>
Modifier and Type | Field and Description |
---|---|
private AbstractValidator<? super V>[] |
validators
The child validators.
|
PROPERTY_MANDATORY, PROPERTY_MAXIMUM, PROPERTY_MINIMUM
Constructor and Description |
---|
ValidatorMapValues(AbstractValidator<? super V>... validators)
The constructor.
|
ValidatorMapValues(List<AbstractValidator<? super V>> validators)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
AbstractValidator<?> |
getValidator(int index)
Gets the
ValueValidator at the given index . |
int |
getValidatorCount() |
int |
hashCode() |
ValidationFailure |
validate(Map<?,V> map,
Object valueSource)
This method validates the given
value . |
append, contains, createBundle, getCode, getProperty, isDynamic, isMandatory, validate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
validate
private final AbstractValidator<? super V>[] validators
@SafeVarargs public ValidatorMapValues(AbstractValidator<? super V>... validators)
validators
- the AbstractValidator
s used to validate
each element.public ValidatorMapValues(List<AbstractValidator<? super V>> validators)
validators
- the AbstractValidator
s used to validate
each element.public AbstractValidator<?> getValidator(int index)
ComposedValueValidator
ValueValidator
at the given index
.getValidator
in interface ComposedValueValidator<Map<?,V>>
index
- is the index of the ValueValidator
to get.ValueValidator
.List.get(int)
public int getValidatorCount()
getValidatorCount
in interface ComposedValueValidator<Map<?,V>>
validators
.ComposedValueValidator.getValidator(int)
,
Collection.size()
public ValidationFailure validate(Map<?,V> map, Object valueSource)
ValueValidator
value
.validate
in interface ValueValidator<Map<?,V>>
map
- is the value to validate.valueSource
- is the source
describing the origin of the given
value
. This may be the filename where the value was read from, an XPath where the value was located
in an XML document, the label of a widget of the UI containing the value, etc. This will help to find the
problem easier. The source needs to have a reasonable string-representation
as
this may be displayed to the end-user to locate the source of the failure. In most cases it is suitable to
directly pass a String
.ValidationFailure
or null
if the given value
is valid according to this
ValueValidator
.public int hashCode()
hashCode
in class AbstractValidator<Map<?,V>>
public boolean equals(Object obj)
equals
in class AbstractValidator<Map<?,V>>
Copyright © 2001–2016 mmm-Team. All rights reserved.