Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.jgoodies.binding.beans
Class BeanAdapter.SimplePropertyAdapter

    java.lang.Object
      com.jgoodies.common.bean.Bean
          com.jgoodies.binding.beans.Model
              com.jgoodies.binding.value.AbstractValueModel
                  com.jgoodies.binding.beans.BeanAdapter.SimplePropertyAdapter

All Implemented Interfaces:
  ValueModel, com.jgoodies.common.bean.ObservableBean, com.jgoodies.common.bean.ObservableBean2, Serializable

Enclosing class:
  BeanAdapter<B>

    public class BeanAdapter.SimplePropertyAdapter

extends AbstractValueModel

Implements the access to the individual bean properties. All SimplePropertyAdapters created by this BeanAdapter share a single PropertyChangeListener that is used to fire value changes in this SimplePropertyAdapter.

This class is public to enable reflection access.

See Also:
  Serialized Form

Field Summary

Fields inherited from class com.jgoodies.common.bean.Bean
`changeSupport`

Fields inherited from interface com.jgoodies.binding.value.ValueModel
`PROPERTY_VALUE`

Constructor Summary
`protected` | `BeanAdapter.SimplePropertyAdapter(String propertyName, String getterName, String setterName)` Constructs a SimplePropertyAdapter for the given property name, getter and setter name.

Method Summary
`protected void` | `fireChange(B currentBean)`
`protected void` | `fireChange(Object oldValue, Object newValue)`
`Object` | `getValue()` Returns the value of the adapted bean property, or null if the bean is null.
`protected String` | `paramString()` Returns a string representing the state of this model.
`protected void` | `setBean0(B oldBean, B newBean)`
`void` | `setValue(Object newValue)` Sets the given object as new value of the adapted bean property.
`void` | `setVetoableValue(Object newValue)` Sets the given object as new value of the adapted bean property.

Methods inherited from class com.jgoodies.binding.value.AbstractValueModel
`addValueChangeListener, booleanValue, doubleValue, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, fireValueChange, floatValue, getString, intValue, longValue, removeValueChangeListener, setValue, setValue, setValue, setValue, setValue, toString, valueString`

Methods inherited from class com.jgoodies.binding.beans.Model
`createPropertyChangeSupport, firePropertyChange`

Methods inherited from class com.jgoodies.common.bean.Bean
`addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### BeanAdapter.SimplePropertyAdapter

    protected BeanAdapter.SimplePropertyAdapter(String propertyName,
                                                String getterName,
                                                String setterName)

  Constructs a SimplePropertyAdapter for the given property name, getter and setter name.

  Parameters:
    `propertyName` - the name of the property to adapt
    `getterName` - the name of the method that reads the value
    `setterName` - the name of the method that sets the value

Method Detail

### getValue

    public Object getValue()

  Returns the value of the adapted bean property, or null if the bean is null.

  Returns:
    the value of the adapted bean property, null if the bean is null

### setValue

    public void setValue(Object newValue)

  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 listener 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
    `PropertyNotFoundException` - if the property could not be found
    `PropertyAccessException` - if the new value could not be set

### setVetoableValue

    public void setVetoableValue(Object newValue)
                          throws PropertyVetoException

  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 listener 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
    `PropertyNotFoundException` - if the property could not be found
    `PropertyAccessException` - if the new value could not be set
    `PropertyVetoException` - if the invoked bean setter throws a PropertyVetoException
  Since:
    1.1

### fireChange

    protected void fireChange(B currentBean)

### fireChange

    protected void fireChange(Object oldValue,
                              Object newValue)

### setBean0

    protected void setBean0(B oldBean,
                            B newBean)

### paramString

    protected String paramString()

  Description copied from class: `AbstractValueModel`
  Returns a string representing the state of this model. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be `null`.

  Overrides:
    `paramString` in class `AbstractValueModel`
  Returns:
    a string representation of this model's state

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002-2013 JGoodies Software GmbH. All Rights Reserved.