Java String validation using enum values and annotation

后端 未结 8 1515
暖寄归人
暖寄归人 2020-11-30 23:47

I want to validate a string against a set of values using annotations.

What I want is basically this:

@ValidateString(enumClass=com.co.enum)
String d         


        
8条回答
  •  情话喂你
    2020-12-01 00:09

    Here is a detailed example with the feature of a dynamic error message by Hibernate Documentation

    https://docs.jboss.org/hibernate/validator/4.1/reference/en-US/html/validator-customconstraints.html#validator-customconstraints-simple

提交回复
热议问题