英文:
How to perform Email type verification during parsing(OpenCSV, spring boot)?
问题
我正在使用opencsv在Spring Boot中从csv文件中读取数据。
和往常一样,我使用了@CsvBindByName注解,将csv的每一列绑定到所需的实体成员上。
但是假设我有一个字符串字段,它必须具有电子邮件的结构,是否存在一个注解来正确解析并检查它是否符合正确的电子邮件格式?
示例:
@Email
@CsvBindByName(required = true)
private String email;
非常感谢!
英文:
I am using opencsv to read from a csv file in Spring boot.
Like usual, I have used @csvbindbyname annotation to bind every column(of csv) to the required entity member.
But say if I have a string field, which must have the structure of an Email, is there an annotation present to parse correctly and check if it follows a correct email pattern??
Example
@Email
@CsvBindByName(required = true)
private String email;
Thank you so much!
专注分享java语言的经验与见解,让所有开发者获益!
评论