Top Description Fields Constructors Methods
org.hibernate.validator.internal.cfg.context

public Class DefaultConstraintMapping

extends Object
implements ConstraintMapping
Class Inheritance
All Implemented Interfaces
org.hibernate.validator.cfg.ConstraintMapping
Static Imports
org.hibernate.validator.internal.util.CollectionHelper.newHashSet, org.hibernate.validator.internal.util.logging.Messages.MESSAGES

Default implementation of ConstraintMapping.
Authors
Hardy Ferentschik, Gunnar Morling, Kevin Pollet <[email protected]> (C) 2011 SERLI

Field Summary

Modifier and TypeField and Description
private final AnnotationProcessingOptionsImpl
private final Set<Class<?>>
private final Set<ConstraintDefinitionContextImpl<?>>
private final Set<Class<?>>
private final JavaBeanHelper
private static final Log
private final Set<TypeConstraintMappingContextImpl<?>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public <A extends Annotation> ConstraintDefinitionContext<A>
constraintDefinition(Class<A>
The annotation class on which to define the validators. This type must be an @interface annotated with jakarta.validation.Constraint. All validators defined after calling this method are added to the annotation of the type annotationClass until the next call of type or annotation.
annotationClass
)

Implements org.hibernate.validator.cfg.ConstraintMapping.constraintDefinition.

Starts defining jakarta.validation.ConstraintValidators to be executed for the specified constraint (i.e. annotation class).
public final AnnotationProcessingOptionsImpl
public Set<BeanConfiguration<?>>

Returns:

a set of BeanConfigurations with an element for each type configured through this mapping
getBeanConfigurations
(ConstraintCreationContext
the constraint creation context
constraintCreationContext
)

Returns all bean configurations configured through this constraint mapping.

public Set<Class<?>>
public Set<ConstraintDefinitionContribution<?>>
public final <C> TypeConstraintMappingContext<C>
type(Class<C>
The bean class on which to define constraints. All constraints defined after calling this method are added to the bean of the type beanClass until the next call of type or annotation.
type
)

Implements org.hibernate.validator.cfg.ConstraintMapping.type.

Deprecated as a consequence of TypeConstraintMappingContext being deprecated.
Starts defining constraints on the specified bean class.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

annotationProcessingOptionsback to summary
private final AnnotationProcessingOptionsImpl annotationProcessingOptions
configuredTypesback to summary
private final Set<Class<?>> configuredTypes
constraintContextsback to summary
private final Set<ConstraintDefinitionContextImpl<?>> constraintContexts
definedConstraintsback to summary
private final Set<Class<?>> definedConstraints
javaBeanHelperback to summary
private final JavaBeanHelper javaBeanHelper
LOGback to summary
private static final Log LOG
typeContextsback to summary
private final Set<TypeConstraintMappingContextImpl<?>> typeContexts

Constructor Detail

DefaultConstraintMappingback to summary
public DefaultConstraintMapping(JavaBeanHelper javaBeanHelper)

Method Detail

constraintDefinitionback to summary
public <A extends Annotation> ConstraintDefinitionContext<A> constraintDefinition(Class<A> annotationClass)

Implements org.hibernate.validator.cfg.ConstraintMapping.constraintDefinition.

Doc from org.hibernate.validator.cfg.ConstraintMapping.constraintDefinition.

Starts defining jakarta.validation.ConstraintValidators 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.

Parameters
<A>
The annotation type to be configured.
annotationClass:Class<A>

The annotation class on which to define the validators. This type must be an @interface annotated with jakarta.validation.Constraint. All validators defined after calling this method are added to the annotation of the type annotationClass until the next call of type or annotation.

Returns:ConstraintDefinitionContext<A>

Instance allowing for defining validators to be executed for the specified constraint.

Annotations
@Override
getAnnotationProcessingOptionsback to summary
public final AnnotationProcessingOptionsImpl getAnnotationProcessingOptions()
getBeanConfigurationsback to summary
public Set<BeanConfiguration<?>> getBeanConfigurations(ConstraintCreationContext constraintCreationContext)

Returns all bean configurations configured through this constraint mapping.

Parameters
constraintCreationContext:ConstraintCreationContext

the constraint creation context

Returns:Set<BeanConfiguration<?>>

a set of BeanConfigurations with an element for each type configured through this mapping

getConfiguredTypesback to summary
public Set<Class<?>> getConfiguredTypes()
getConstraintDefinitionContributionsback to summary
public Set<ConstraintDefinitionContribution<?>> getConstraintDefinitionContributions()
typeback to summary
public final <C> TypeConstraintMappingContext<C> type(Class<C> type)

Implements org.hibernate.validator.cfg.ConstraintMapping.type.

Doc from org.hibernate.validator.cfg.ConstraintMapping.type.

Deprecated

as a consequence of TypeConstraintMappingContext being deprecated. See corresponding docs for further information.

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.

Parameters
<C>
The type to be configured.
type:Class<C>

The bean class on which to define constraints. All constraints defined after calling this method are added to the bean of the type beanClass until the next call of type or annotation.

Returns:TypeConstraintMappingContext<C>

Instance allowing for defining constraints on the specified class.

Annotations
@Override