Top Description Fields Constructors Methods
org.springframework.validation.annotation

public abstract Class ValidationAnnotationUtils

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, org.springframework.core.annotation.AnnotationUtils, org.springframework.lang.Nullable

Utility class for handling validation annotations. Mainly for internal use within the framework.
Authors
Christoph Dreis, Juergen Hoeller
Since
5.3.7

Field Summary

Modifier and TypeField and Description
private static final Object[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Object[]
public static Object[]

Returns:

the validation hints to apply (possibly an empty array), or null if this annotation does not trigger any validation
determineValidationHints
(Annotation
the annotation (potentially a validation annotation)
ann
)

Determine any validation hints by the given annotation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_OBJECT_ARRAYback to summary
private static final Object[] EMPTY_OBJECT_ARRAY

Constructor Detail

ValidationAnnotationUtilsback to summary
public ValidationAnnotationUtils()

Method Detail

convertValidationHintsback to summary
private static Object[] convertValidationHints(Object hints)
determineValidationHintsback to summary
public static Object[] determineValidationHints(Annotation ann)

Determine any validation hints by the given annotation.

This implementation checks for Spring's org.springframework.validation.annotation.Validated, @jakarta.validation.Valid, and custom annotations whose name starts with "Valid" which may optionally declare validation hints through the "value" attribute.

Parameters
ann:Annotation

the annotation (potentially a validation annotation)

Returns:Object[]

the validation hints to apply (possibly an empty array), or null if this annotation does not trigger any validation

Annotations
@Nullable