com.miginfocom.property
Class PropertyBean<T>

java.lang.Object
  extended by com.miginfocom.property.Property<T>
      extended by com.miginfocom.property.PropertyBean<T>
All Implemented Interfaces:
FieldProperty<T>, java.io.Serializable, PropertyI<T>, PropertyListener

public class PropertyBean<T>
extends Property<T>
implements PropertyListener

A property that should be used as a holder of a bean that holds other properties.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.miginfocom.property.Property
UNINITIALIZED
 
Constructor Summary
PropertyBean()
           
PropertyBean(T bean)
           
 
Method Summary
protected  T create()
          Lazily creates the value at first use if it was not set in the constructor.
protected  void initNotify()
          Called when the property has been properly initialized.
 void propertyChange(PropertyEvent e)
           
 Result<T> set(T value)
          Set the value of this property.
 
Methods inherited from class com.miginfocom.property.Property
addPropertyListener, addPropertyListener, checkInit, cloneObject, createInfo, get, getBean, getInfo, getInternal, getName, init, isNull, makeUnmodifiable, removePropertyListener, setInternal, toString, writeReplace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyBean

public PropertyBean()

PropertyBean

public PropertyBean(T bean)
Method Detail

initNotify

protected void initNotify()
Description copied from class: Property
Called when the property has been properly initialized. Default implementation is empty.

Can be overridden to do property specific initialization.

Overrides:
initNotify in class Property<T>

create

protected T create()
Description copied from class: Property
Lazily creates the value at first use if it was not set in the constructor. Default implementation returns null.

Should be overridden by sub classes to return default values.

It is a requirement that this method is only called a maximum of one time for an object instance.

Overrides:
create in class Property<T>
Returns:
null by default.

set

public Result<T> set(T value)
Description copied from interface: PropertyI
Set the value of this property. The base interface makes no assuptions on this value at all. It might or might not be cloned for storage and it might or might not be null.

Specified by:
set in interface PropertyI<T>
Overrides:
set in class Property<T>
Parameters:
value - The value.
Returns:
The result of the set. Should default to Result.ok() if not special logic for value checking is made.

propertyChange

public void propertyChange(PropertyEvent e)
Specified by:
propertyChange in interface PropertyListener
Parameters:
e - The event object. Never null.


Copyright © 2007 MiG InfoCom AB. All Rights Reserved.