Class ConstraintValidators
java.lang.Object
org.apache.logging.log4j.core.config.plugins.validation.ConstraintValidators
Utility class to locate an appropriate
ConstraintValidator
implementation for an annotation.- Since:
- 2.1
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection
<ConstraintValidator<?>> findValidators
(Annotation... annotations) Finds all relevantConstraintValidator
objects from an array of annotations.private static Type
getConstraintValidatorAnnotationType
(Class<? extends ConstraintValidator<?>> type) private static <A extends Annotation>
ConstraintValidator<A> getValidator
(A annotation, Class<? extends A> type)
-
Constructor Details
-
ConstraintValidators
private ConstraintValidators()
-
-
Method Details
-
findValidators
Finds all relevantConstraintValidator
objects from an array of annotations. All validators will beinitialized
before being returned.- Parameters:
annotations
- the annotations to find constraint validators for- Returns:
- a collection of ConstraintValidators for the given annotations
-
getValidator
private static <A extends Annotation> ConstraintValidator<A> getValidator(A annotation, Class<? extends A> type) -
getConstraintValidatorAnnotationType
private static Type getConstraintValidatorAnnotationType(Class<? extends ConstraintValidator<?>> type)
-