Joda System API

org.joda.property.impl.data
Class CodedBeanPropertyData

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

public final class CodedBeanPropertyData
extends AbstractPropertyData

CodedBeanPropertyData uses reflection to access the get and set methods declared on the bean. The get and set methods do not have to be public. If the set method is non-public the property defaults to unmodifiable. If there is no set method, the property is read only.

Author:
Stephen Colebourne
See Also:
Serialized Form

Constructor Summary
CodedBeanPropertyData(AbstractBean bean, java.lang.String propertyName)
          Constructor
 
Method Summary
 java.lang.Object get()
          Get the value of the property.
 java.lang.Class getPropertyType()
          Get the type of the property as determined by refection
 boolean isModifiable()
          Is the property currently modifiable.
 boolean isReadOnly()
          Is the property permanently unmodifiable.
 void set(java.lang.Object object)
          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

CodedBeanPropertyData

public CodedBeanPropertyData(AbstractBean bean,
                             java.lang.String propertyName)
Constructor

Parameters:
bean - the bean to call the methods on
propertyName - the name of the property to access
Method Detail

get

public java.lang.Object get()
Description copied from interface: PropertyData
Get the value of the property. The object type will be appropriate for the type of property.

Returns:
the Object previously stored by a set(Object)
See Also:
PropertyData.get()

set

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

Parameters:
object - an Object to store
See Also:
PropertyData.set(Object)

isModifiable

public 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 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 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 void setReadOnly()
Description copied from interface: PropertyData
Set the property permanently unmodifiable.

See Also:
PropertyData.setReadOnly()

getPropertyType

public java.lang.Class getPropertyType()
Get the type of the property as determined by refection


Joda System API

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