Joda System API

org.joda.property.impl.data
Class UnmodifiablePropertyData

java.lang.Object
  |
  +--org.joda.property.impl.data.AbstractPropertyData
        |
        +--org.joda.property.impl.data.UnmodifiablePropertyData
All Implemented Interfaces:
InitializablePropertyData, PropertyData, java.io.Serializable

public abstract class UnmodifiablePropertyData
extends AbstractPropertyData

Derived property data implementation which gets a piece of unmodifiable data.

Subclasses will typically derive their data from other properties on the parent Property. To fire the correct events when those properties change, call addDependentOn() from the initParentCreated() method.

Author:
Stephen Colebourne
See Also:
Serialized Form

Constructor Summary
UnmodifiablePropertyData()
          Constructor
 
Method Summary
 void addDependentOn(Property property)
          Add a property that this property is dependent on.
abstract  java.lang.Object get()
          Get the value of the property.
 boolean isModifiable()
          Is the property currently modifiable.
 boolean isReadOnly()
          Is the property permanently unmodifiable.
 void set(java.lang.Object obj)
          Set the value of the property.
 void setModifiable(boolean modifiable)
          Set the flag to indicate if the object is currently modifiable.
 void setReadOnly()
          Set the property permanently unmodifiable.
 
Methods inherited from class org.joda.property.impl.data.AbstractPropertyData
addPropertyChangeListener, bean, firePropertyChange, firePropertyChange, initPropertyDataCreated, property, removePropertyChangeListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.joda.property.impl.PropertyData
equals, hashCode
 

Constructor Detail

UnmodifiablePropertyData

public UnmodifiablePropertyData()
Constructor

Method Detail

addDependentOn

public void addDependentOn(Property property)
Add a property that this property is dependent on. This should be called from initBeanCreated(), not initPropertyCreated().

Parameters:
property - the property that this depends on

get

public abstract java.lang.Object get()
Get the value of the property.

Returns:
the object value of the property

set

public final void set(java.lang.Object obj)
Description copied from interface: PropertyData
Set the value of the property. The object type should be appropriate for the type of property.

Parameters:
obj - an Object to store
See Also:
PropertyData.setModifiable(boolean)

isModifiable

public final boolean isModifiable()
Description copied from interface: PropertyData
Is the property currently modifiable.

Returns:
true if the property value can currently be changed
See Also:
PropertyData.isModifiable()

setModifiable

public final void setModifiable(boolean modifiable)
Description copied from interface: PropertyData
Set the flag to indicate if the object is currently modifiable.

Parameters:
modifiable - true if object should be modifiable
See Also:
PropertyData.setModifiable(boolean)

isReadOnly

public final boolean isReadOnly()
Description copied from interface: PropertyData
Is the property permanently unmodifiable.

Returns:
true if the property value can never be modified
See Also:
PropertyData.isReadOnly()

setReadOnly

public final void setReadOnly()
Description copied from interface: PropertyData
Set the property permanently unmodifiable.

See Also:
PropertyData.setReadOnly()

Joda System API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.