Class BeanValidationProcessor
- All Implemented Interfaces:
GeneratorSpecProcessor
The main goals of this implementation are:
- support single annotations
- support combinations of annotations from different providers
- produce repeatable results regardless of declaration order
All of the above is done on a best-effort basis and is not guaranteed to work in all circumstances.
When multiple annotations are declared, the processor first determines
and consumes the primary annotation. Primary annotations are those
that can only be applied to a certain type and have a certain meaning, e.g.
@Email, @URL, @UUID
. Currently, all supported primary annotations
target character sequences. Once a primary annotation has been consumed,
the processor will apply the remaining annotations.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
process
(@NotNull GeneratorSpec<?> spec, @NotNull Class<?> targetClass, @Nullable Field field) Processes given generator spec.
-
Constructor Details
-
BeanValidationProcessor
public BeanValidationProcessor()
-
-
Method Details
-
process
public void process(@NotNull @NotNull GeneratorSpec<?> spec, @NotNull @NotNull Class<?> targetClass, @Nullable @Nullable Field field) Description copied from interface:GeneratorSpecProcessor
Processes given generator spec.The
targetClass
parameter may differ fromField.getType()
. This could be the case where the field is declared using aTypeVariable
, in which case field's type will beObject
. Alternatively, a subtype may have been specified via the API.- Specified by:
process
in interfaceGeneratorSpecProcessor
- Parameters:
spec
- generator spec to processtargetClass
- class being generatedfield
- field the generated value will be assigned to
-