org.beanfabrics
Class BnModelObserver

java.lang.Object
  extended by org.beanfabrics.AbstractBean
      extended by org.beanfabrics.BnModelObserver
All Implemented Interfaces:
Bean, ModelSubscriber, View<PresentationModel>

public class BnModelObserver
extends AbstractBean
implements View<PresentationModel>, ModelSubscriber

Observer for the PresentationModel object located at the end of a specified Path relatively to a ModelProvider's root. Fires a PropertyChangeEvent (with property name "presentationModel") whenever the model reference or the model properties change. The method getPresentationModel() returns that model.


Constructor Summary
BnModelObserver()
          Creates a new instance.
 
Method Summary
 IModelProvider getModelProvider()
          Returns the provider.
 Path getPath()
          Returns the path.
 PresentationModel getPresentationModel()
          Returns the PresentationModel of this view.
 void setModelProvider(IModelProvider provider)
          Sets the provider.
 void setPath(Path path)
          Sets the path.
 void setPresentationModel(PresentationModel presentationModel)
          Sets the PresentationModel of this view.
 
Methods inherited from class org.beanfabrics.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, equals, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BnModelObserver

public BnModelObserver()
Creates a new instance.

Method Detail

getPresentationModel

public PresentationModel getPresentationModel()
Returns the PresentationModel of this view.

Specified by:
getPresentationModel in interface View<PresentationModel>
Returns:
the PresentationModel

setPresentationModel

public void setPresentationModel(PresentationModel presentationModel)
Sets the PresentationModel of this view.

Specified by:
setPresentationModel in interface View<PresentationModel>
Parameters:
presentationModel - the PresentationModel

getModelProvider

public IModelProvider getModelProvider()
Returns the provider.

Specified by:
getModelProvider in interface ModelSubscriber
Returns:
the ModelProvider

setModelProvider

public void setModelProvider(IModelProvider provider)
Sets the provider.

Specified by:
setModelProvider in interface ModelSubscriber
Parameters:
provider - the provider

getPath

public Path getPath()
Returns the path.

Specified by:
getPath in interface ModelSubscriber
Returns:
the path

setPath

public void setPath(Path path)
Sets the path. The Path is used to locate the model inside the provider.

Specified by:
setPath in interface ModelSubscriber
Parameters:
path - the path relative to the provider's root model