Class DefaultConstraintMapping
- java.lang.Object
-
- org.hibernate.validator.internal.cfg.context.DefaultConstraintMapping
-
- All Implemented Interfaces:
ConstraintMapping
public class DefaultConstraintMapping extends Object implements ConstraintMapping
Default implementation ofConstraintMapping.- Author:
- Hardy Ferentschik, Gunnar Morling, Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI
-
-
Constructor Summary
Constructors Constructor Description DefaultConstraintMapping(JavaBeanHelper javaBeanHelper)
-
Method Summary
All Methods Instance Methods Concrete 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.AnnotationProcessingOptionsImplgetAnnotationProcessingOptions()Set<BeanConfiguration<?>>getBeanConfigurations(ConstraintCreationContext constraintCreationContext)Returns all bean configurations configured through this constraint mapping.Set<Class<?>>getConfiguredTypes()Set<ConstraintDefinitionContribution<?>>getConstraintDefinitionContributions()<C> TypeConstraintMappingContext<C>type(Class<C> type)Starts defining constraints on the specified bean class.
-
-
-
Constructor Detail
-
DefaultConstraintMapping
public DefaultConstraintMapping(JavaBeanHelper javaBeanHelper)
-
-
Method Detail
-
type
public final <C> TypeConstraintMappingContext<C> type(Class<C> type)
Description copied from interface:ConstraintMappingStarts 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.- Specified by:
typein interfaceConstraintMapping- Type Parameters:
C- The type to be configured.- Parameters:
type- 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.
-
getAnnotationProcessingOptions
public final AnnotationProcessingOptionsImpl getAnnotationProcessingOptions()
-
getBeanConfigurations
public Set<BeanConfiguration<?>> getBeanConfigurations(ConstraintCreationContext constraintCreationContext)
Returns all bean configurations configured through this constraint mapping.- Parameters:
constraintCreationContext- the constraint creation context- Returns:
- a set of
BeanConfigurations with an element for each type configured through this mapping
-
constraintDefinition
public <A extends Annotation> ConstraintDefinitionContext<A> constraintDefinition(Class<A> annotationClass)
Description copied from interface:ConstraintMappingStarts 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.- Specified by:
constraintDefinitionin interfaceConstraintMapping- 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.
-
getConstraintDefinitionContributions
public Set<ConstraintDefinitionContribution<?>> getConstraintDefinitionContributions()
-
-