gpt4 book ai didi

java - Bean绑定(bind) vetoableChangeSupport addVetoableChangeListener

转载 作者:行者123 更新时间:2023-12-02 08:10:24 25 4
gpt4 key购买 nike

任何人都可以知道 vetoableChangeSupport.addVetoableChangeListener 是什么。我在 Beansbinding 中找到了这个。 vetoableChangeSupport.addVetoableChangeListener 的用途及其用途。您也可以去 here 。我们如何在beansbinding和应用程序开发中使用它?谢谢

最佳答案

来自 JavaDoc:

You can register a VetoableChangeListener with a source bean so as to be notified of any constrained property updates.

来自 JavaDoc 上的 vetoableChange(...) 方法:

PropertyVetoException - if the recipient wishes the property change to be rolled back.

这表示您使用 VetoableChangeListener 来监听属性更改,如果更改违反您通过该监听器施加的约束,它会抛出 PropertyVetoException ,这会导致更改将被回滚。

这里是 VetoableChangeSupport 的 JavaDoc,其中包括示例:http://download.oracle.com/javase/7/docs/api/java/beans/VetoableChangeSupport.html

关于java - Bean绑定(bind) vetoableChangeSupport addVetoableChangeListener,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7529941/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com