Class ValidationAnnotationUtils

java.lang.Object
org.springframework.validation.annotation.ValidationAnnotationUtils

public abstract class ValidationAnnotationUtils extends Object
Utility class for handling validation annotations.

Mainly for internal use within the framework.

Since:
5.3.7
Author:
Christoph Dreis, Juergen Hoeller
  • Constructor Details

    • ValidationAnnotationUtils

      public ValidationAnnotationUtils()
  • Method Details

    • determineValidationHints

      public static Object @Nullable [] determineValidationHints(Annotation ann)
      Determine any validation hints for the given annotation.

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

      Parameters:
      ann - the annotation (potentially a validation annotation)
      Returns:
      the validation hints to apply (possibly an empty array), or null if this annotation does not trigger any validation
    • determineValidationGroups

      public static Class<?>[] determineValidationGroups(Object target, Method method)
      Determine the applicable validation groups from an @Validated annotation either on the method, or on the containing target class of the method, or for an AOP proxy without a target (with all behavior in advisors), also check on proxied interfaces.
      Since:
      7.0.4