This repository was archived by the owner on Nov 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Features #9
Copy link
Copy link
Open
Description
- supporting javax.validation?
- supporting jakarta.validation
- Thought to annotate the conctructors so checks are currently only added on constructors
-
Support JSR 380 annotations on fields? - No "validate" method on classes with constructors that don't have JSR 380 annotations
- Add "but was %s" to messages?
- Group support
- Support for custom message (
@Min(value = 18, message = "Age should not be less than 18"),@Email(message = "Email yada yada yada")) - Feature to turn on to generate for ALL notations by default or only if the constructor/class has a
@Vaadooannotation (opt-in/opt-out via@Vaadoo(ignore = true), see config file feature) - Break build on senseless combinations like
@NotNull+@NotEmpty, ...) warn on redundant e.g. where code checks for nulls as well, e.g.@NotNull+@NotBlank, cnfigurable level: break 'never', 'senseless', 'redundant' (e.g.@Positive+@PositiveOrZero). What about checking the values? e.g.@Min(42)+@Max(41). Also@Size(-2)is senseless since CharSequence/Map/Collection/Arrays never can have a size of < 0. Perhaps we could use/delegate to https://github.com/hibernate/hibernate-validator - Support logging, see https://github.com/raphw/byte-buddy/blob/master/byte-buddy-maven-plugin/README.md
- Is/should there be an annotation evaluation order?
- Support type constraints (e.g. List<
@NotBlankString>) - Collecting implementation that verifies ALL constraints and throw an Exception containing all violations
- PBTs that generate bytecode, transform it and run it (
@NotEmptyand checks with all valid types and some invalid ones) - Inlining "validate" method(s)? https://lsieun.github.io/assets/pdf/asm-transformations.pdf https://github.com/xxDark/asm-inline
- Fields are no more considered "unused" if we do call some method like checkArgument with them: Can we tell the compiler to ignore the "validate" method?
- Check if the code fragment copied into the target method has no field access or method calls to the code fragment class
- Optimization: If there's a field access we could copy the field to the target class, so we could use static final fields, e.g. for the email regexp. But this would be a three step transformation: Tracks field names before reading methods (to prevent name clashes when adding fields), then when copying code change the field access owner to the target class and after that add the new fields to the class.
- Support for repeating annotations
- Support for custom validators, custom validators are annotations that are annotated by
@Constraint(validatedBy = FooValidator.class) - optimize custom validators analog RegexCache
- Use messages like hibernate reference implementation src/main/resources/org/hibernate/validator/ValidationMessages.properties (also I18N)
- generate docs of business rules of the domain objects (e.g. number of Foo valid between 1 and 9999)
- config option to remove the annotations in the bytecode for which the validate code has been added
- Make i18n configurable: option to set locale (load that resourcebundle) and option to use own resourcebundles via config
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels