This is a custom validator based on Jakarta validation-api, inspired by org.hibernate.validator.constraints.ScriptAssert.
The source code is so tiny, you can read it as document :)
@SpELAssert("#p.maxAge > 100") // repeatable annotation@SpELAssert(expression = "#_.maxAge > 100", alias = "_") // alias support@SpELAssert( expression ={"#p.minAge < #p.maxAge", "and #p.minAge > 10"}, // multi-line expressionsmessage = "Max must greater than min age, min age must greater than 10", reportOn = "minAge" ) publicclassConfig{@SpELAssert("@springBean.method(#p)") // spring bean invokeprivateStringname; privateIntegerminAge; privateIntegermaxAge}

