org.beanfabrics
Interface IModelProvider

All Known Implementing Classes:
ModelProvider

public interface IModelProvider

A container for an PresentationModel object. ModelProviderListeners can subscribe for change events on the structure of the presentation object model.

Author:
Michael Karneim

Method Summary
 void addModelProviderListener(Path path, ModelProviderListener l)
          Adds a ModelProviderListener to the listener list.
<T extends PresentationModel>
T
getPresentationModel()
          Returns the presentation model hold by this container.
<T extends PresentationModel>
T
getPresentationModel(Path path)
          Returns the presentation model found at the end of the specified path or null if nothing is found.
 java.lang.Class<? extends PresentationModel> getPresentationModelType()
          Returns the type of the presentation model object.
 void removeModelProviderListener(Path path, ModelProviderListener l)
          Removes a ModelProviderListener from the listener list that was registered for a specific path.
 void setPresentationModel(PresentationModel pModel)
          Sets the presentation model root object.
 void setPresentationModelType(java.lang.Class<? extends PresentationModel> newType)
          Sets the type of presentation model object.
 

Method Detail

getPresentationModelType

java.lang.Class<? extends PresentationModel> getPresentationModelType()
Returns the type of the presentation model object.

Returns:
the type of the presentation model object

setPresentationModelType

void setPresentationModelType(java.lang.Class<? extends PresentationModel> newType)
Sets the type of presentation model object.

Parameters:
newType - the type of the presentation model to set

getPresentationModel

<T extends PresentationModel> T getPresentationModel()
Returns the presentation model hold by this container.

Type Parameters:
T - the provided presentation model type
Returns:
the presentation model hold by this container

setPresentationModel

void setPresentationModel(PresentationModel pModel)
Sets the presentation model root object.

Parameters:
pModel - the root presentation model to set

getPresentationModel

<T extends PresentationModel> T getPresentationModel(Path path)
Returns the presentation model found at the end of the specified path or null if nothing is found.

Type Parameters:
T - the provided presentation model type
Parameters:
path - the path which references the presentation model
Returns:
the presentation model found at the end of the specified path or null if nothing was found

addModelProviderListener

void addModelProviderListener(Path path,
                              ModelProviderListener l)
Adds a ModelProviderListener to the listener list. The listener is registered for all structural changes along the given path and will be informed whenever the model reference at the end of the path changes.

Parameters:
path - the path which references the presentation model
l - the listener to add

removeModelProviderListener

void removeModelProviderListener(Path path,
                                 ModelProviderListener l)
Removes a ModelProviderListener from the listener list that was registered for a specific path.

Parameters:
path - the path which references the presentation model
l - the listener to remove


© 2010 by Michael Karneim, http://www.beanfabrics.org