Beanbinding vetoableChangeSupport addVetoableChangeListener

621 Views Asked by At

Any one can tell what vetoableChangeSupport.addVetoableChangeListener is. I found this in Beansbinding. What vetoableChangeSupport.addVetoableChangeListener is for and its uses.Also you can go here. How can we get make use of it in beansbinding and application developing? Thank you

1

There are 1 best solutions below

2
Thomas On

From the JavaDoc:

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

And from the JavaDoc on the vetoableChange(...) method:

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

This indicates you use the VetoableChangeListener to listen for property changes and if a change would violate a constraint you impose through that listener, it throws a PropertyVetoException which should cause the change to be rolled back.

Here's the JavaDoc for VetoableChangeSupport which includes examples: http://download.oracle.com/javase/7/docs/api/java/beans/VetoableChangeSupport.html