public abstract class AbstractCollectionValidator<T>
extends java.lang.Object
| Constructor and Description |
|---|
AbstractCollectionValidator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildErrorMessage(java.lang.String qualifier,
java.lang.String key,
int index,
ConstraintValidatorContext context)
Builds an error message for the given message key, index and qualifier.
|
protected java.util.Locale |
getCurrentLocale() |
protected java.lang.String |
getLocalizedString(java.util.Locale locale,
java.lang.String key,
java.lang.Object... objects) |
protected boolean |
isNotBlank(java.lang.String value) |
boolean |
isValid(java.util.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(java.util.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(java.lang.String qualifier,
java.lang.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(java.lang.String value)
protected java.util.Locale getCurrentLocale()
protected java.lang.String getLocalizedString(java.util.Locale locale,
java.lang.String key,
java.lang.Object... objects)
Copyright © 2018 SAP SE. All Rights Reserved.