任何人都可以知道 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/