Top Description Inners Methods
javax.validation

public Interface ConstraintValidatorContext

Imports
java.time.Clock

Provides contextual data and operation when applying a given constraint validator. At least one ConstraintViolation must be defined (either the default one, of if the default ConstraintViolation is disabled, a custom one).
Authors
Emmanuel Bernard, Guillaume Smet

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ConstraintValidatorContext.ConstraintViolationBuilder

ConstraintViolation builder allowing to optionally associate the violation report to a sub path.

Method Summary

Modifier and TypeMethod and Description
public ConstraintValidatorContext.ConstraintViolationBuilder

Returns:

returns a constraint violation builder
buildConstraintViolationWithTemplate
(String
new un-interpolated constraint message
messageTemplate
)

Returns a constraint violation builder building a violation report allowing to optionally associate it to a sub path.

public void
disableDefaultConstraintViolation()

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

public ClockProvider

Returns:

the provider for obtaining the current time, never null. If no specific provider has been configured during bootstrap, a default implementation using the current system time and the current default time zone as returned by Clock#systemDefaultZone() will be returned.
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 String

Returns:

the current un-interpolated default message
getDefaultConstraintMessageTemplate
()

public <
the type of the object to be returned
T
>
T

Returns:

an instance of the specified class
unwrap
(Class<T>
the class of the object to be returned
type
)

Returns an instance of the specified type allowing access to provider-specific APIs.