Package dev.orne.test.rnd.params
Class ConstraintIntrospector
java.lang.Object
dev.orne.test.rnd.params.ConstraintIntrospector
Utility class for retrieving constraints annotations from generation
targets.
- Since:
- 0.1
- Version:
- 1.1, 2023-11
- Author:
- (w) Iker Hernaez
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull Set<Annotation>
findConstructorParameterConstrains
(@NotNull Constructor<?> constructor, int parameterIndex, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified constructor parameter for the specified validation groups.static @NotNull Set<Annotation>
findConstructorParameterConstrains
(@NotNull javax.validation.Validator validator, @NotNull Constructor<?> constructor, int parameterIndex, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified constructor parameter for the specified validation groups.static @NotNull Set<Annotation>
findMethodParameterConstrains
(@NotNull Method method, int parameterIndex, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified method parameter for the specified validation groups.static @NotNull Set<Annotation>
findMethodParameterConstrains
(@NotNull javax.validation.Validator validator, @NotNull Method method, int parameterIndex, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified method parameter for the specified validation groups.static @NotNull Set<Annotation>
findMethodResultConstrains
(@NotNull Method method, Class<?>... groups) Retrieves the constraint annotations of the specified method result for the specified validation groups.static @NotNull Set<Annotation>
findMethodResultConstrains
(@NotNull javax.validation.Validator validator, @NotNull Method method, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified method result for the specified validation groups.static @NotNull Set<Annotation>
findParameterConstrains
(@NotNull Parameter parameter, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified parameter for the specified validation groups.static @NotNull Set<Annotation>
findParameterConstrains
(@NotNull javax.validation.Validator validator, @NotNull Parameter parameter, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified parameter for the specified validation groups.static @NotNull Set<Annotation>
findPropertyConstrains
(@NotNull Class<?> type, @NotNull String property, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified property for the specified validation groups.static @NotNull Set<Annotation>
findPropertyConstrains
(@NotNull javax.validation.Validator validator, @NotNull Class<?> type, @NotNull String property, @NotNull Class<?>... groups) Retrieves the constraint annotations of the specified property for the specified validation groups.
-
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.
-