Custom validation annotation in Spring
This sample Spring Boot application contains examples of how to create custom constrain annotations (like e.g. @NotNull) with corresponding validator classes.
Each subpackage of
com.dolszewski.blog presents a different use case.
- basic - The most simple constrain that can be created.
- parametrized - A plain constrain with an additional custom attribute.
- multitype - A constrain applicable to several different types.
- crossfield - A constrain which verifies several class fields