0

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

divibisan
  • 11,659
  • 11
  • 40
  • 58
Débora
  • 5,816
  • 28
  • 99
  • 171

1 Answers1

2

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

Thomas
  • 87,414
  • 12
  • 119
  • 157
  • is there a difference/s between firepropertychangeListener? – Débora Sep 23 '11 at 15:13
  • 1
    @Aash please read the JavaDoc on those classes and methods. If you mean the `firePropertyChange()` method - well the difference is that the listeners informed by that method can't veto (cause a rollback of) the change, i.e. they are just informed, that's it. – Thomas Sep 23 '11 at 15:25