public abstract class AbstractCollectionValidator<T> extends Object
| Constructor and Description |
|---|
AbstractCollectionValidator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildErrorMessage(String qualifier,
String key,
int index,
ConstraintValidatorContext context)
Builds an error message for the given message key, index and qualifier.
|
protected Locale |
getCurrentLocale() |
protected String |
getLocalizedString(Locale locale,
String key,
Object... objects) |
protected boolean |
isNotBlank(String value) |
boolean |
isValid(Collection<T> value,
ConstraintValidatorContext context)
Checks if the given collection is valid.
|
protected abstract boolean |
isValidObject(T object,
int index,
ConstraintValidatorContext context) |
public boolean isValid(Collection<T> value, ConstraintValidatorContext context)
Each object in the collection has to be valid.
All object are checked, there is no interruption if the first invalid object is found.
value - the collection with the values to checkcontext - true if all objects in the collection are valid, otherwise falseprotected abstract boolean isValidObject(T object, int index, ConstraintValidatorContext context)
protected void buildErrorMessage(String qualifier, String key, int index, ConstraintValidatorContext context)
qualifier - attribute qualifierkey - key of a message in a message bundleindex - the actual index in the listcontext - used to create error messagesprotected boolean isNotBlank(String value)
protected Locale getCurrentLocale()
Copyright © 2017 SAP SE. All Rights Reserved.