Top Inners Fields Constructors Methods
org.hibernate.validator.internal.engine.constraintvalidation

public Class ConstraintValidatorContextImpl

extends Object
implements HibernateConstraintValidatorContext
Class Inheritance
All Implemented Interfaces
org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext, jakarta.validation.ConstraintValidatorContext
Known Direct Subclasses
org.hibernate.validator.internal.engine.constraintvalidation.CrossParameterConstraintValidatorContextImpl
Imports
java.lang.annotation.Annotation, java.lang.invoke.MethodHandles, java.util.ArrayList, .Collections, .HashMap, .List, .Map, jakarta.validation.ClockProvider, .ConstraintValidatorContext, .ConstraintValidatorContext.ConstraintViolationBuilder.ContainerElementNodeBuilderCustomizableContext, .ConstraintValidatorContext.ConstraintViolationBuilder.ContainerElementNodeBuilderDefinedContext, .ConstraintValidatorContext.ConstraintViolationBuilder.ContainerElementNodeContextBuilder, .ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeBuilderCustomizableContext, .ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeBuilderDefinedContext, .ConstraintValidatorContext.ConstraintViolationBuilder.LeafNodeContextBuilder, .ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderCustomizableContext, .ConstraintValidatorContext.ConstraintViolationBuilder.NodeBuilderDefinedContext, .ConstraintValidatorContext.ConstraintViolationBuilder.NodeContextBuilder, .ElementKind, jakarta.validation.metadata.ConstraintDescriptor, org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext, .HibernateConstraintViolationBuilder, org.hibernate.validator.internal.engine.path.PathImpl, org.hibernate.validator.internal.util.CollectionHelper, .Contracts, org.hibernate.validator.internal.util.logging.Log, .LoggerFactory, org.hibernate.validator.messageinterpolation.ExpressionLanguageFeatureLevel

Authors
Hardy Ferentschik, Gunnar Morling, Guillaume Smet

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected class
private class
protected class
private abstract class

Field Summary

Modifier and TypeField and Description
private final PathImpl
private final ClockProvider
private final ConstraintDescriptor<?>
private final Object
private List<ConstraintViolationCreationContext>
private final ExpressionLanguageFeatureLevel
private final ExpressionLanguageFeatureLevel
private boolean
private Object
private Map<String, Object>
private static final Log
private Map<String, Object>

Constructor Summary

AccessConstructor and Description
public
ConstraintValidatorContextImpl(ClockProvider clockProvider, PathImpl propertyPath, ConstraintDescriptor<?> constraintDescriptor, Object constraintValidatorPayload, ExpressionLanguageFeatureLevel defaultConstraintExpressionLanguageFeatureLevel, ExpressionLanguageFeatureLevel defaultCustomViolationExpressionLanguageFeatureLevel)

Method Summary

Modifier and TypeMethod and Description
public HibernateConstraintValidatorContext
addExpressionVariable(String
the name under which to bind the expression variable, cannot be null
name
,
Object
the value to be bound to the specified name
value
)

Implements org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext.addExpressionVariable.

Allows to set an additional expression variable which will be available as an EL variable during interpolation.
public HibernateConstraintValidatorContext
addMessageParameter(String
the name under which to bind the parameter, cannot be null
name
,
Object
the value to be bound to the specified name
value
)

Implements org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext.addMessageParameter.

Allows to set an additional named parameter which can be interpolated in the constraint violation message.
public HibernateConstraintViolationBuilder
buildConstraintViolationWithTemplate(String
new un-interpolated constraint message
messageTemplate
)

Implements org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext.buildConstraintViolationWithTemplate.

Returns a constraint violation builder building a violation report allowing to optionally associate it to a sub path.
public final void
disableDefaultConstraintViolation()

Implements jakarta.validation.ConstraintValidatorContext.disableDefaultConstraintViolation.

Disables the default ConstraintViolation object generation (which is using the message template declared on the constraint).
public ClockProvider
getClockProvider()

Implements jakarta.validation.ConstraintValidatorContext.getClockProvider.

Returns the provider for obtaining the current time in the form of a Clock, e.g. when validating the Future and Past constraints.
public final ConstraintDescriptor<?>
public <C> C
getConstraintValidatorPayload(Class<C>
the type of payload to retrieve
type
)

Implements org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext.getConstraintValidatorPayload.

Returns an instance of the specified type or null if the current constraint validator payload isn't of the given type.
public final List<ConstraintViolationCreationContext>
protected final PathImpl
public final String
private ConstraintViolationCreationContext
public <T> T
unwrap(Class<T>
the class of the object to be returned
type
)

Implements jakarta.validation.ConstraintValidatorContext.unwrap.

Returns an instance of the specified type allowing access to provider-specific APIs.
public HibernateConstraintValidatorContext
withDynamicPayload(Object
an object representing additional information about the violation
violationContext
)

Implements org.hibernate.validator.constraintvalidation.HibernateConstraintValidatorContext.withDynamicPayload.

Allows to set an object that may further describe the violation.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait