Class ConstraintIntrospector

java.lang.Object
dev.orne.test.rnd.params.ConstraintIntrospector

@API(status=EXPERIMENTAL, since="0.1") public final class ConstraintIntrospector extends Object
Utility class for retrieving constraints annotations from generation targets.
Since:
0.1
Version:
1.1, 2023-11
Author:
(w) Iker Hernaez
  • Method Details

    • findPropertyConstrains

      @NotNull public static @NotNull Set<Annotation> findPropertyConstrains(@NotNull @NotNull Class<?> type, @NotNull @NotNull String property, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified property for the specified validation groups.
      Parameters:
      type - The bean type.
      property - The property name.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified property.
    • findPropertyConstrains

      @NotNull public static @NotNull Set<Annotation> findPropertyConstrains(@NotNull @NotNull javax.validation.Validator validator, @NotNull @NotNull Class<?> type, @NotNull @NotNull String property, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified property for the specified validation groups.
      Parameters:
      validator - The validator to use.
      type - The bean type.
      property - The property name.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified property.
    • findParameterConstrains

      @NotNull public static @NotNull Set<Annotation> findParameterConstrains(@NotNull @NotNull Parameter parameter, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified parameter for the specified validation groups.
      Parameters:
      parameter - The target parameter.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified parameter.
      Since:
      0.2
    • findParameterConstrains

      @NotNull public static @NotNull Set<Annotation> findParameterConstrains(@NotNull @NotNull javax.validation.Validator validator, @NotNull @NotNull Parameter parameter, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified parameter for the specified validation groups.
      Parameters:
      validator - The validator to use.
      parameter - The target parameter.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified parameter.
      Since:
      0.2
    • findMethodParameterConstrains

      @NotNull public static @NotNull Set<Annotation> findMethodParameterConstrains(@NotNull @NotNull Method method, int parameterIndex, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified method parameter for the specified validation groups.
      Parameters:
      method - The target method.
      parameterIndex - The parameter index.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified method parameter.
    • findMethodParameterConstrains

      @NotNull public static @NotNull Set<Annotation> findMethodParameterConstrains(@NotNull @NotNull javax.validation.Validator validator, @NotNull @NotNull Method method, int parameterIndex, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified method parameter for the specified validation groups.
      Parameters:
      validator - The validator to use.
      method - The target method.
      parameterIndex - The parameter index.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified method parameter.
    • findMethodResultConstrains

      @NotNull public static @NotNull Set<Annotation> findMethodResultConstrains(@NotNull @NotNull Method method, Class<?>... groups)
      Retrieves the constraint annotations of the specified method result for the specified validation groups.
      Parameters:
      method - The target method.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified method result.
    • findMethodResultConstrains

      @NotNull public static @NotNull Set<Annotation> findMethodResultConstrains(@NotNull @NotNull javax.validation.Validator validator, @NotNull @NotNull Method method, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified method result for the specified validation groups.
      Parameters:
      validator - The validator to use.
      method - The target method.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified method result.
    • findConstructorParameterConstrains

      @NotNull public static @NotNull Set<Annotation> findConstructorParameterConstrains(@NotNull @NotNull Constructor<?> constructor, int parameterIndex, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified constructor parameter for the specified validation groups.
      Parameters:
      constructor - The target constructor.
      parameterIndex - The parameter index.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified constructor parameter.
    • findConstructorParameterConstrains

      @NotNull public static @NotNull Set<Annotation> findConstructorParameterConstrains(@NotNull @NotNull javax.validation.Validator validator, @NotNull @NotNull Constructor<?> constructor, int parameterIndex, @NotNull @NotNull Class<?>... groups)
      Retrieves the constraint annotations of the specified constructor parameter for the specified validation groups.
      Parameters:
      validator - The validator to use.
      constructor - The target constructor.
      parameterIndex - The parameter index.
      groups - The validation groups.
      Returns:
      The constraint annotations of the specified constructor parameter.