设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 软件追踪 查看内容

Bean Validation 2.0发布,并通过JCP投票成为规范

2017-8-8 22:42| 发布者: joejoe0332| 查看: 947| 评论: 0|原作者: oschina|来自: oschina

摘要: 经过一年的努力开发以及自上一次修订之后的四年多时间,Bean Validation 2.0 (JSR 380) 的最终正式版终于发布了。上周,JCP 执行委员会以 25 票赞成票一致通过了 JSR 的最终批准投票。投票结束后,就发布了 2.0.0 版 ...

经过一年的努力开发以及自上一次修订之后的四年多时间,Bean Validation 2.0 (JSR 380) 的最终正式版终于发布了。

上周,JCP 执行委员会以 25 票赞成票一致通过了 JSR 的最终批准投票。投票结束后,就发布了 2.0.0 版本的规范、API 和 TCK。与此同时,参考 Bean Validation 最终版本的实现,Hibernate Validator 6 最终版也发布了。

接下来的几天内,最终的规范将在 jcp.org 上的 JSR 380 页面提供。

Bean Validation 2.0 的新特性概览:

  • Support for validating container elements by annotating type arguments of parameterized types, e.g. List<@Positive Integer> positiveNumbers; this also includes:

    • More flexible cascaded validation of collection types; e.g. values and keys of maps can be validated now: Map<@Valid CustomerType, @Valid Customer> customersByType

    • Support for java.util.Optional

    • Support for the property types declared by JavaFX

    • Support for custom container types by plugging in additional value extractors

  • Support for the JSR 310 date/time types for @Past and @Future; fine-grained control over the current time and time zone used for validation

  • New built-in constraints: @Email@NotEmpty@NotBlank@Positive@PositiveOrZero@Negative@NegativeOrZero@PastOrPresent and @FutureOrPresent

  • All built-in constraints are marked as repeatable

  • Parameter names are retrieved using reflection

  • ConstraintValidator#initialize() is a default method

Bean Validation 2.0 也将成为 Java EE 8 规范的一部分,它将在今年夏天发布。

来自:http://beanvalidation.org/


酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部