org.jage.property
Class Property

java.lang.Object
  extended by org.jage.property.Property
Direct Known Subclasses:
FieldProperty, GetterSetterProperty, PropertyFunction, SimpleProperty

public abstract class Property
extends Object

Base, abstract class for all properties.

Author:
Tomek

Constructor Summary
Property()
          Constructor.
 
Method Summary
 void addMonitor(AbstractPropertyMonitor monitor, IPropertyMonitorRule rule)
          Registers monitor for this property.
abstract  MetaProperty getMetaProperty()
          Returns metadata for this property.
protected  PropertyValueMonitoringStrategy getMonitoringStrategy()
          Creates monitoring strategy for this property.
 SimpleProperty getSimpleProperty()
          Provides simple version of this property that does not have any monitors and additional stuff.
abstract  Object getValue()
          Returns value of this property.
protected  void initializeMonitoringStrategy()
          Initializes monitoring strategy for the property.
 void notifyMonitors(Object newValue)
          Notify monitors about property change.
 void notifyMonitors(Object newValue, boolean forceNotifying)
          Notify monitors about property change.
 void objectDeleted(AbstractEvent event)
          Informs the property that is has been deleted.
 void removeMonitor(AbstractPropertyMonitor monitor)
          Unregisters monitor from this property.
abstract  void setValue(Object value)
          Sets value of this property.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Property

public Property()
Constructor.

Method Detail

initializeMonitoringStrategy

protected void initializeMonitoringStrategy()
Initializes monitoring strategy for the property.


getMonitoringStrategy

protected PropertyValueMonitoringStrategy getMonitoringStrategy()
Creates monitoring strategy for this property.

Returns:

getMetaProperty

public abstract MetaProperty getMetaProperty()
Returns metadata for this property.

Returns:
metadata for this property.

getValue

public abstract Object getValue()
Returns value of this property.

Returns:
value of this property.

setValue

public abstract void setValue(Object value)
                       throws InvalidPropertyOperationException
Sets value of this property.

Parameters:
value - new value.
Throws:
InvalidPropertyOperationException - property is read-only.

addMonitor

public void addMonitor(AbstractPropertyMonitor monitor,
                       IPropertyMonitorRule rule)
                throws InvalidPropertyOperationException
Registers monitor for this property.

Parameters:
monitor - monitor to register.
rule - monitor rule.
Throws:
InvalidPropertyOperationException - property is not monitorable.

removeMonitor

public void removeMonitor(AbstractPropertyMonitor monitor)
                   throws InvalidPropertyOperationException
Unregisters monitor from this property.

Parameters:
monitor - monitor to unregister.
Throws:
InvalidPropertyOperationException - property is not monitorable.

notifyMonitors

public void notifyMonitors(Object newValue)
Notify monitors about property change. Monitors are notified even if the new value is the same as the old one.

Parameters:
newValue - new value of the property.

notifyMonitors

public void notifyMonitors(Object newValue,
                           boolean forceNotifying)
Notify monitors about property change.

Parameters:
newValue - new value of the property.
foceNotyfying - if this parameter is true, monitors are notified even if the new value is the same as the old one.

objectDeleted

public void objectDeleted(AbstractEvent event)
Informs the property that is has been deleted.

Parameters:
event -

getSimpleProperty

public SimpleProperty getSimpleProperty()
Provides simple version of this property that does not have any monitors and additional stuff. Suitable for serialization.

Returns:
instance of simple property

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2006-2011 AGH University of Science and Technology. All Rights Reserved.