Java Doc for PropertyAdapter.java in  » Swing-Library » jgoodies-data-binding » com » jgoodies » binding » beans » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » jgoodies data binding » com.jgoodies.binding.beans 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.jgoodies.binding.beans.Model
      com.jgoodies.binding.value.AbstractValueModel
         com.jgoodies.binding.beans.PropertyAdapter

PropertyAdapter
final public class PropertyAdapter extends AbstractValueModel (Code)
Converts a single Java Bean property into the generic ValueModel interface. The bean property must be a single value as described by the Java Bean Specification. See below for a comparison with the more frequently used BeanAdapter and PresentationModel classes.

The constructors accept either a property name or a triple of (property name, getter name, setter name). If you just specify the property name, the adapter uses the standard Java Bean introspection to lookup the available properties and how to read and write the property value. In case of custom readers and writers you may specify a custom BeanInfo class, or as a shortcut use the constructors that accept the optional getter and setter name. If these are specified, introspection will be bypassed and a PropertyDescriptor will be created for the given property name, getter and setter name.

Optionally the PropertyAdapter can observe changes in bound properties as described in section 7.4 of the Bean specification. You can enable this feature by setting the constructor parameter observeChanges to true. If the adapter observes changes, it will fire value change events, i.e. PropertyChangeEvents for the property "value". Even if you ignore property changes, you can access the adapted property value via #getValue(). It's just that you won't be notified about changes.

The PropertyAdapter provides two access styles to the target bean that holds the adapted property: you can specify a bean directly, or you can use a bean channel to access the bean indirectly. In the latter case you specify a ValueModel that holds the bean that in turn holds the adapted property.

If the adapted bean is null the PropertyAdapter can neither read nor set a value. In this case #getValue returns null and #setValue will silently ignore the new value.

This adapter throws three PropertyChangeEvents if the bean changes: beforeBean, bean and afterBean. This is useful when sharing a bean channel and you must perform an operation before or after other listeners handle a bean change. Since you cannot rely on the order listeners will be notified, only the beforeBean and afterBean events are guaranteed to be fired before and after the bean change is fired. Note that #getBean() returns the new bean before any of these three PropertyChangeEvents is fired. Therefore listeners that handle these events must use the event's old and new value to determine the old and new bean. The order of events fired during a bean change is:

  1. this adapter's bean channel fires a value change,
  2. this adapter fires a beforeBean change,
  3. this adapter fires the bean change,
  4. this adapter fires an afterBean change.

Note: PropertyAdapters that observe changes have a PropertyChangeListener registered with the target bean. Hence, a bean has a reference to any PropertyAdapter that observes it. To avoid memory leaks it is recommended to remove this listener if the bean lives much longer than the PropertyAdapter, enabling the garbage collector to remove the adapter. To do so, you can call setBean(null) or set the bean channel's value to null. As an alternative you can use event listener lists in your beans that implement references with WeakReference.

Setting the bean to null has side-effects, for example the adapter fires a change event for the bound property bean and other properties. And the adpter's value may change. However, typically this is fine and setting the bean to null is the first choice for removing the reference from the bean to the adapter. Another way to clear the reference from the target bean is to call #release. It has no side-effects, but the adapter must not be used anymore once #release has been called.

Constraints: If property changes shall be observed, the bean class must support bound properties, i. e. it must provide the following pair of methods for registration of multicast property change event listeners:

 public void addPropertyChangeListener(PropertyChangeListener x);
 public void removePropertyChangeListener(PropertyChangeListener x);
 
PropertyAdapter vs. BeanAdapter vs. PresentationModel
If you adapt multiple properties of the same bean, you better use a com.jgoodies.binding.beans.BeanAdapter . The BeanAdapter registers only a single PropertyChangeListener with the bean, where multiple PropertyAdapters would register multiple listeners. If you adapt bean properties for an editor, you will typically use the com.jgoodies.binding.PresentationModel . The PresentationModel is more powerful than the BeanAdapter. It adds support for buffered models, and provides an extensible mechanism for observing the change state of the bean and related objects.

Basic Examples:

 // Direct access, ignores changes
 Address address = new Address()
 PropertyAdapter adapter = new PropertyAdapter(address, "street");
 adapter.setValue("Broadway");
 System.out.println(address.getStreet());    // Prints "Broadway"
 address.setStreet("Franz-Josef-Strasse");
 System.out.println(adapter.getValue());     // Prints "Franz-Josef-Strasse"
 //Direct access, observes changes
 PropertyAdapter adapter = new PropertyAdapter(address, "street", true);
 // Indirect access, ignores changes
 ValueHolder addressHolder = new ValueHolder(address1);
 PropertyAdapter adapter = new PropertyAdapter(addressHolder, "street");
 adapter.setValue("Broadway");               // Sets the street in address1
 System.out.println(address1.getValue());    // Prints "Broadway"
 adapter.setBean(address2);
 adapter.setValue("Robert-Koch-Strasse");    // Sets the street in address2
 System.out.println(address2.getValue());    // Prints "Robert-Koch-Strasse"
 // Indirect access, observes changes
 ValueHolder addressHolder = new ValueHolder();
 PropertyAdapter adapter = new PropertyAdapter(addressHolder, "street", true);
 addressHolder.setValue(address1);
 address1.setStreet("Broadway");
 System.out.println(adapter.getValue());     // Prints "Broadway"
 
Adapter Chain Example:
Builds an adapter chain from a domain model to the presentation layer.
 Country country = new Country();
 country.setName("Germany");
 country.setEuMember(true);
 JTextField nameField = new JTextField();
 nameField.setDocument(new DocumentAdapter(
 new PropertyAdapter(country, "name", true)));
 JCheckBox euMemberBox = new JCheckBox("Is EU Member");
 euMemberBox.setModel(new ToggleButtonAdapter(
 new PropertyAdapter(country, "euMember", true)));
 // Using factory methods
 JTextField nameField   = Factory.createTextField(country, "name");
 JCheckBox  euMemberBox = Factory.createCheckBox (country, "euMember");
 euMemberBox.setText("Is EU Member");
 

TODO: Consider adding a feature to ensure that update notifications are performed in the event dispatch thread. In case the adapted bean is changed in a thread other than the event dispatch thread, such a feature would help complying with Swing's single thread rule. The feature could be implemented by an extended PropertyChangeSupport.

TODO: I plan to improve the support for adapting beans that do not fire PropertyChangeEvents. This affects the classes PropertyAdapter, BeanAdapter, and PresentationModel. Basically the PropertyAdapter and the BeanAdapter's internal SimplePropertyAdapter's shall be able to optionally self-fire a PropertyChangeEvent in case the bean does not. There are several downsides with self-firing events compared to bound bean properties. See Issue 49 for more information about the downsides.

The observeChanges constructor parameter shall be replaced by a more fine-grained choice to not observe (former observeChanges=false), to observe bound properties (former observeChanges=true), and a new setting for self-firing PropertyChangeEvents if a value is set. The latter case may be further splitted up to specify how the self-fired PropertyChangeEvent is created:

  1. oldValue=null, newValue=null
  2. oldValue=null, newValue=the value set
  3. oldValue=value read before the set, newValue=the value set
  4. oldValue=value read before the set, newValue=value read after the set

author:
   Karsten Lentzsch
version:
   $Revision: 1.13 $
See Also:   com.jgoodies.binding.beans.BeanAdapter
See Also:   ValueModel
See Also:   ValueModel.getValue
See Also:   ValueModel.setValue(Object)
See Also:   PropertyChangeEvent
See Also:   PropertyChangeListener
See Also:   java.beans.Introspector
See Also:   java.beans.BeanInfo
See Also:   PropertyDescriptor<
Parameters:
  B - > the type of the adapted bean


Field Summary
final public static  StringPROPERTYNAME_AFTER_BEAN
     The property name used in the PropertyChangeEvent that is fired after the bean property fires its PropertyChangeEvent. Useful to perform an operation after listeners that handle the bean change are notified.
final public static  StringPROPERTYNAME_BEAN
     The name of the read-write bound property that holds the target bean.
final public static  StringPROPERTYNAME_BEFORE_BEAN
     The property name used in the PropertyChangeEvent that is fired before the bean property fires its PropertyChangeEvent. Useful to perform an operation before listeners that handle the bean change are notified.
final public static  StringPROPERTYNAME_CHANGED
     The name of the read-only bound bean property that indicates whether one of the observed properties has changed.

Constructor Summary
public  PropertyAdapter(B bean, String propertyName)
     Constructs a PropertyAdapter for the given bean and property name; does not observe changes.
public  PropertyAdapter(B bean, String propertyName, boolean observeChanges)
     Constructs a PropertyAdapter for the given bean and property name; observes changes if specified.
Parameters:
  bean - the bean that owns the property
Parameters:
  propertyName - the name of the adapted property
Parameters:
  observeChanges - true to observe changes of boundor constrained properties, false to ignore changes
throws:
  NullPointerException - if propertyName is null
throws:
  IllegalArgumentException - if propertyName is empty
throws:
  PropertyUnboundException - if observeChangesis true but the property is unbound, i.
public  PropertyAdapter(B bean, String propertyName, String getterName, String setterName)
     Constructs a PropertyAdapter for the given bean, property name, getter and setter name; does not observe changes.
public  PropertyAdapter(B bean, String propertyName, String getterName, String setterName, boolean observeChanges)
     Constructs a PropertyAdapter for the given bean, property name, getter and setter name; observes changes if specified.
Parameters:
  bean - the bean that owns the property
Parameters:
  propertyName - the name of the adapted property
Parameters:
  getterName - the optional name of the property reader
Parameters:
  setterName - the optional name of the property writer
Parameters:
  observeChanges - true to observe changes of boundor constrained properties, false to ignore changes
throws:
  NullPointerException - if propertyName is null
throws:
  IllegalArgumentException - if propertyName is empty
throws:
  PropertyUnboundException - if observeChangesis true but the property is unbound, i.
public  PropertyAdapter(ValueModel beanChannel, String propertyName)
     Constructs a PropertyAdapter for the given bean channel and property name; does not observe changes.
public  PropertyAdapter(ValueModel beanChannel, String propertyName, boolean observeChanges)
     Constructs a PropertyAdapter for the given bean channel and property name; observes changes if specified.
Parameters:
  beanChannel - the ValueModel that holds the bean
Parameters:
  propertyName - the name of the adapted property
Parameters:
  observeChanges - true to observe changes of boundor constrained properties, false to ignore changes
throws:
  NullPointerException - if beanChannel orpropertyName is null
throws:
  IllegalArgumentException - if propertyName is empty
throws:
  PropertyUnboundException - if observeChangesis true but the property is unbound, i.
public  PropertyAdapter(ValueModel beanChannel, String propertyName, String getterName, String setterName)
     Constructs a PropertyAdapter for the given bean channel, property name, getter and setter name; does not observe changes.
public  PropertyAdapter(ValueModel beanChannel, String propertyName, String getterName, String setterName, boolean observeChanges)
     Constructs a PropertyAdapter for the given bean channel, property name, getter and setter name; observes changes if specified.
Parameters:
  beanChannel - the ValueModel that holds the bean
Parameters:
  propertyName - the name of the adapted property
Parameters:
  getterName - the optional name of the property reader
Parameters:
  setterName - the optional name of the property writer
Parameters:
  observeChanges - true to observe changes of boundor constrained properties, false to ignore changes
throws:
  NullPointerException - if propertyName is null
throws:
  IllegalArgumentException - if propertyName is empty
throws:
  IllegalArgumentException - if the bean channel is a ValueHolderthat has the identityCheck feature disabled
throws:
  PropertyUnboundException - if observeChangesis true but the property is unbound, i.

Method Summary
public  BgetBean()
     Returns the Java Bean that holds the adapted property.
public  booleangetObserveChanges()
     Answers whether this adapter observes changes in the adapted Bean property.
public  StringgetPropertyName()
     Returns the name of the adapted Java Bean property.
public  ObjectgetValue()
     Returns the value of the bean's adapted property, null if the current bean is null.

If the adapted bean property is write-only, this adapter is write-only too, and this operation is not supported and throws an exception.

public  booleanisChanged()
     Answers whether a bean property has changed since the changed state has been reset.
public  voidrelease()
     Removes the PropertyChangeHandler from the observed bean, if the bean is not null and if property changes are observed.

PropertyAdapters that observe changes have a PropertyChangeListener registered with the target bean.

public  voidresetChanged()
     Resets this tracker's changed state to false.
public  voidsetBean(B newBean)
     Sets a new Java Bean as holder of the adapted property.
public  voidsetValue(Object newValue)
     Sets the given object as new value of the adapted bean property. Does nothing if the bean is null.
public  voidsetVetoableValue(Object newValue)
     Sets the given object as new value of the adapted bean property. Does nothing if the bean is null.

Field Detail
PROPERTYNAME_AFTER_BEAN
final public static String PROPERTYNAME_AFTER_BEAN(Code)
The property name used in the PropertyChangeEvent that is fired after the bean property fires its PropertyChangeEvent. Useful to perform an operation after listeners that handle the bean change are notified. See also the class comment.



PROPERTYNAME_BEAN
final public static String PROPERTYNAME_BEAN(Code)
The name of the read-write bound property that holds the target bean.
See Also:   PropertyAdapter.getBean()
See Also:   PropertyAdapter.setBean(Object)



PROPERTYNAME_BEFORE_BEAN
final public static String PROPERTYNAME_BEFORE_BEAN(Code)
The property name used in the PropertyChangeEvent that is fired before the bean property fires its PropertyChangeEvent. Useful to perform an operation before listeners that handle the bean change are notified. See also the class comment.



PROPERTYNAME_CHANGED
final public static String PROPERTYNAME_CHANGED(Code)
The name of the read-only bound bean property that indicates whether one of the observed properties has changed.
See Also:   PropertyAdapter.isChanged()




Constructor Detail
PropertyAdapter
public PropertyAdapter(B bean, String propertyName)(Code)
Constructs a PropertyAdapter for the given bean and property name; does not observe changes.
Parameters:
  bean - the bean that owns the property
Parameters:
  propertyName - the name of the adapted property
throws:
  NullPointerException - if propertyName is null
throws:
  IllegalArgumentException - if propertyName is empty



PropertyAdapter
public PropertyAdapter(B bean, String propertyName, boolean observeChanges)(Code)
Constructs a PropertyAdapter for the given bean and property name; observes changes if specified.
Parameters:
  bean - the bean that owns the property
Parameters:
  propertyName - the name of the adapted property
Parameters:
  observeChanges - true to observe changes of boundor constrained properties, false to ignore changes
throws:
  NullPointerException - if propertyName is null
throws:
  IllegalArgumentException - if propertyName is empty
throws:
  PropertyUnboundException - if observeChangesis true but the property is unbound, i. e. the beandoes not provide a pair of methods to register a multicastPropertyChangeListener



PropertyAdapter
public PropertyAdapter(B bean, String propertyName, String getterName, String setterName)(Code)
Constructs a PropertyAdapter for the given bean, property name, getter and setter name; does not observe changes.
Parameters:
  bean - the bean that owns the property
Parameters:
  propertyName - the name of the adapted property
Parameters:
  getterName - the optional name of the property reader
Parameters:
  setterName - the optional name of the property writer
throws:
  NullPointerException - if propertyName is null
throws:
  IllegalArgumentException - if propertyName is empty



PropertyAdapter
public PropertyAdapter(B bean, String propertyName, String getterName, String setterName, boolean observeChanges)(Code)
Constructs a PropertyAdapter for the given bean, property name, getter and setter name; observes changes if specified.
Parameters:
  bean - the bean that owns the property
Parameters:
  propertyName - the name of the adapted property
Parameters:
  getterName - the optional name of the property reader
Parameters:
  setterName - the optional name of the property writer
Parameters:
  observeChanges - true to observe changes of boundor constrained properties, false to ignore changes
throws:
  NullPointerException - if propertyName is null
throws:
  IllegalArgumentException - if propertyName is empty
throws:
  PropertyUnboundException - if observeChangesis true but the property is unbound, i. e. the beandoes not provide a pair of methods to register a multicastPropertyChangeListener



PropertyAdapter
public PropertyAdapter(ValueModel beanChannel, String propertyName)(Code)
Constructs a PropertyAdapter for the given bean channel and property name; does not observe changes.
Parameters:
  beanChannel - the ValueModel that holds the bean
Parameters:
  propertyName - the name of the adapted property
throws:
  NullPointerException - if beanChannel orpropertyName is null
throws:
  IllegalArgumentException - if propertyName is empty



PropertyAdapter
public PropertyAdapter(ValueModel beanChannel, String propertyName, boolean observeChanges)(Code)
Constructs a PropertyAdapter for the given bean channel and property name; observes changes if specified.
Parameters:
  beanChannel - the ValueModel that holds the bean
Parameters:
  propertyName - the name of the adapted property
Parameters:
  observeChanges - true to observe changes of boundor constrained properties, false to ignore changes
throws:
  NullPointerException - if beanChannel orpropertyName is null
throws:
  IllegalArgumentException - if propertyName is empty
throws:
  PropertyUnboundException - if observeChangesis true but the property is unbound, i. e. the beandoes not provide a pair of methods to register a multicastPropertyChangeListener
throws:
  PropertyAccessException - if the beanChannel's valuedoes not provide a property descriptor for propertyName



PropertyAdapter
public PropertyAdapter(ValueModel beanChannel, String propertyName, String getterName, String setterName)(Code)
Constructs a PropertyAdapter for the given bean channel, property name, getter and setter name; does not observe changes.
Parameters:
  beanChannel - the ValueModel that holds the bean
Parameters:
  propertyName - the name of the adapted property
Parameters:
  getterName - the optional name of the property reader
Parameters:
  setterName - the optional name of the property writer
throws:
  NullPointerException - if beanChannel orpropertyName is null
throws:
  IllegalArgumentException - if propertyName is empty



PropertyAdapter
public PropertyAdapter(ValueModel beanChannel, String propertyName, String getterName, String setterName, boolean observeChanges)(Code)
Constructs a PropertyAdapter for the given bean channel, property name, getter and setter name; observes changes if specified.
Parameters:
  beanChannel - the ValueModel that holds the bean
Parameters:
  propertyName - the name of the adapted property
Parameters:
  getterName - the optional name of the property reader
Parameters:
  setterName - the optional name of the property writer
Parameters:
  observeChanges - true to observe changes of boundor constrained properties, false to ignore changes
throws:
  NullPointerException - if propertyName is null
throws:
  IllegalArgumentException - if propertyName is empty
throws:
  IllegalArgumentException - if the bean channel is a ValueHolderthat has the identityCheck feature disabled
throws:
  PropertyUnboundException - if observeChangesis true but the property is unbound, i. e. the beandoes not provide a pair of methods to register a multicastPropertyChangeListener
throws:
  PropertyAccessException - if the beanChannel's valuedoes not provide a property descriptor for propertyName




Method Detail
getBean
public B getBean()(Code)
Returns the Java Bean that holds the adapted property. the Bean that holds the adapted property
See Also:   PropertyAdapter.setBean(Object)



getObserveChanges
public boolean getObserveChanges()(Code)
Answers whether this adapter observes changes in the adapted Bean property. true if this adapter observes changes, false if not



getPropertyName
public String getPropertyName()(Code)
Returns the name of the adapted Java Bean property. the name of the adapted property



getValue
public Object getValue()(Code)
Returns the value of the bean's adapted property, null if the current bean is null.

If the adapted bean property is write-only, this adapter is write-only too, and this operation is not supported and throws an exception. the value of the adapted bean property, null if the bean is null
throws:
  UnsupportedOperationException - if the property is write-only
throws:
  PropertyNotFoundException - if the property could not be found
throws:
  PropertyAccessException - if the value could not be read




isChanged
public boolean isChanged()(Code)
Answers whether a bean property has changed since the changed state has been reset. The changed state is implicitly reset every time the target bean changes. true if a property of the current target beanhas changed since the last reset



release
public void release()(Code)
Removes the PropertyChangeHandler from the observed bean, if the bean is not null and if property changes are observed.

PropertyAdapters that observe changes have a PropertyChangeListener registered with the target bean. Hence, a bean has a reference to all PropertyAdapters that observe it. To avoid memory leaks it is recommended to remove this listener if the bean lives much longer than the PropertyAdapter, enabling the garbage collector to remove the adapter. To do so, you can call setBean(null) or set the bean channel's value to null. As an alternative you can use event listener lists in your beans that implement references with WeakReference.

Setting the bean to null has side-effects, for example this adapter fires a change event for the bound property bean and other properties. And this adpter's value may change. However, typically this is fine and setting the bean to null is the first choice for removing the reference from the bean to the adapter. Another way to clear the reference from the target bean is to call #release. It has no side-effects, but the adapter must not be used anymore once #release has been called.
See Also:   PropertyAdapter.setBean(Object)
See Also:   java.lang.ref.WeakReference




resetChanged
public void resetChanged()(Code)
Resets this tracker's changed state to false.



setBean
public void setBean(B newBean)(Code)
Sets a new Java Bean as holder of the adapted property. Notifies any registered value listeners if the value has changed. Also notifies listeners that have been registered with this adapter to observe the bound property bean.
Parameters:
  newBean - the new holder of the property
See Also:   PropertyAdapter.getBean()



setValue
public void setValue(Object newValue)(Code)
Sets the given object as new value of the adapted bean property. Does nothing if the bean is null. If the bean setter throws a PropertyVetoException, it is silently ignored. This write operation is supported only for writable bean properties.

Notifies any registered value listeners if the bean reports a property change. Note that a bean may suppress PropertyChangeEvents if the old and new value are the same, or if the old and new value are equal.
Parameters:
  newValue - the value to set
throws:
  UnsupportedOperationException - if the property is read-only
throws:
  PropertyNotFoundException - if the property could not be found
throws:
  PropertyAccessException - if the new value could not be set




setVetoableValue
public void setVetoableValue(Object newValue) throws PropertyVetoException(Code)
Sets the given object as new value of the adapted bean property. Does nothing if the bean is null. If the bean setter throws a PropertyVetoExeption, this method throws the same exception. This write operation is supported only for writable bean properties.

Notifies any registered value listeners if the bean reports a property change. Note that a bean may suppress PropertyChangeEvents if the old and new value are the same, or if the old and new value are equal.
Parameters:
  newValue - the value to set
throws:
  UnsupportedOperationException - if the property is read-only
throws:
  PropertyNotFoundException - if the property could not be found
throws:
  PropertyAccessException - if the new value could not be set
throws:
  PropertyVetoException - if the invoked bean setterthrows a PropertyVetoException
since:
   1.1




Fields inherited from com.jgoodies.binding.value.AbstractValueModel
final public static String PROPERTYNAME_VALUE(Code)(Java Doc)

Methods inherited from com.jgoodies.binding.value.AbstractValueModel
final public void addValueChangeListener(PropertyChangeListener l)(Code)(Java Doc)
final public boolean booleanValue()(Code)(Java Doc)
final public double doubleValue()(Code)(Java Doc)
final public void fireValueChange(Object oldValue, Object newValue)(Code)(Java Doc)
final public void fireValueChange(Object oldValue, Object newValue, boolean checkIdentity)(Code)(Java Doc)
final public void fireValueChange(boolean oldValue, boolean newValue)(Code)(Java Doc)
final public void fireValueChange(int oldValue, int newValue)(Code)(Java Doc)
final public void fireValueChange(long oldValue, long newValue)(Code)(Java Doc)
final public void fireValueChange(double oldValue, double newValue)(Code)(Java Doc)
final public void fireValueChange(float oldValue, float newValue)(Code)(Java Doc)
final public float floatValue()(Code)(Java Doc)
public String getString()(Code)(Java Doc)
final public int intValue()(Code)(Java Doc)
final public long longValue()(Code)(Java Doc)
final public void removeValueChangeListener(PropertyChangeListener l)(Code)(Java Doc)
final public void setValue(boolean b)(Code)(Java Doc)
final public void setValue(double d)(Code)(Java Doc)
final public void setValue(float f)(Code)(Java Doc)
final public void setValue(int i)(Code)(Java Doc)
final public void setValue(long l)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from com.jgoodies.binding.beans.Model
final public synchronized void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
final public synchronized void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc)
final public synchronized void addVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc)
final public synchronized void addVetoableChangeListener(String propertyName, VetoableChangeListener listener)(Code)(Java Doc)
final protected boolean equals(Object o1, Object o2)(Code)(Java Doc)
final protected void fireIndexedPropertyChange(String propertyName, int index, Object oldValue, Object newValue)(Code)(Java Doc)
final protected void fireIndexedPropertyChange(String propertyName, int index, int oldValue, int newValue)(Code)(Java Doc)
final protected void fireIndexedPropertyChange(String propertyName, int index, boolean oldValue, boolean newValue)(Code)(Java Doc)
final protected void fireMultiplePropertiesChanged()(Code)(Java Doc)
final protected void firePropertyChange(PropertyChangeEvent event)(Code)(Java Doc)
final protected void firePropertyChange(String propertyName, Object oldValue, Object newValue)(Code)(Java Doc)
final protected void firePropertyChange(String propertyName, Object oldValue, Object newValue, boolean checkIdentity)(Code)(Java Doc)
final protected void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)(Code)(Java Doc)
final protected void firePropertyChange(String propertyName, double oldValue, double newValue)(Code)(Java Doc)
final protected void firePropertyChange(String propertyName, float oldValue, float newValue)(Code)(Java Doc)
final protected void firePropertyChange(String propertyName, int oldValue, int newValue)(Code)(Java Doc)
final protected void firePropertyChange(String propertyName, long oldValue, long newValue)(Code)(Java Doc)
final protected void fireVetoableChange(PropertyChangeEvent event) throws PropertyVetoException(Code)(Java Doc)
final protected void fireVetoableChange(String propertyName, Object oldValue, Object newValue) throws PropertyVetoException(Code)(Java Doc)
final protected void fireVetoableChange(String propertyName, boolean oldValue, boolean newValue) throws PropertyVetoException(Code)(Java Doc)
final protected void fireVetoableChange(String propertyName, double oldValue, double newValue) throws PropertyVetoException(Code)(Java Doc)
final protected void fireVetoableChange(String propertyName, int oldValue, int newValue) throws PropertyVetoException(Code)(Java Doc)
final protected void fireVetoableChange(String propertyName, float oldValue, float newValue) throws PropertyVetoException(Code)(Java Doc)
final protected void fireVetoableChange(String propertyName, long oldValue, long newValue) throws PropertyVetoException(Code)(Java Doc)
final public synchronized PropertyChangeListener[] getPropertyChangeListeners()(Code)(Java Doc)
final public synchronized PropertyChangeListener[] getPropertyChangeListeners(String propertyName)(Code)(Java Doc)
final public synchronized VetoableChangeListener[] getVetoableChangeListeners()(Code)(Java Doc)
final public synchronized VetoableChangeListener[] getVetoableChangeListeners(String propertyName)(Code)(Java Doc)
final public synchronized void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
final public synchronized void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)(Code)(Java Doc)
final public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)(Code)(Java Doc)
final public synchronized void removeVetoableChangeListener(String propertyName, VetoableChangeListener listener)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.