Package org.hibernate.validator.cfg
Interface ConstraintMapping
-
- All Known Implementing Classes:
DefaultConstraintMapping
public interface ConstraintMappingRepresents a constraint mapping configured via the programmatic API.- Author:
- Hardy Ferentschik, Gunnar Morling, Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI, Yoann Rodiere
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <A extends Annotation>
ConstraintDefinitionContext<A>constraintDefinition(Class<A> annotationClass)Starts definingConstraintValidators to be executed for the specified constraint (i.e.<C> TypeConstraintMappingContext<C>type(Class<C> beanClass)Starts defining constraints on the specified bean class.
-
-
-
Method Detail
-
type
<C> TypeConstraintMappingContext<C> type(Class<C> beanClass)
Starts defining constraints on the specified bean class. Each bean class may only be configured once within all constraint mappings used for configuring one validator factory.- Type Parameters:
C- The type to be configured.- Parameters:
beanClass- The bean class on which to define constraints. All constraints defined after calling this method are added to the bean of the typebeanClassuntil the next call oftypeorannotation.- Returns:
- Instance allowing for defining constraints on the specified class.
-
constraintDefinition
<A extends Annotation> ConstraintDefinitionContext<A> constraintDefinition(Class<A> annotationClass)
Starts definingConstraintValidators to be executed for the specified constraint (i.e. annotation class). Each constraint may only be configured once within all constraint mappings used for configuring one validator factory.- Type Parameters:
A- The annotation type to be configured.- Parameters:
annotationClass- The annotation class on which to define the validators. This type must be an@interfaceannotated withjakarta.validation.Constraint. All validators defined after calling this method are added to the annotation of the typeannotationClassuntil the next call oftypeorannotation.- Returns:
- Instance allowing for defining validators to be executed for the specified constraint.
- Since:
- 5.3
-
-