|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.beanfabrics.AbstractBean
org.beanfabrics.ModelProvider
public class ModelProvider
The default implementation of a IModelProvider
.
Constructor Summary | |
---|---|
ModelProvider()
Constructs an empty ModelProvider . |
|
ModelProvider(java.lang.Class<? extends PresentationModel> presentationModelType)
Constructs an empty ModelProvider for the given presentationModel type. |
|
ModelProvider(PresentationModel presentationModel)
Constructs a ModelProvider with the given presentationModel. |
Method Summary | ||
---|---|---|
void |
addModelProviderListener(Path path,
ModelProviderListener l)
Adds a ModelProviderListener to the listener list. |
|
|
getPresentationModel()
Returns the PM instance hold by this container. |
|
|
getPresentationModel(Path path)
Returns the PM 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 PM, that is declared to be held at the root node of this provider. |
|
void |
removeModelProviderListener(Path path,
ModelProviderListener l)
Removes a ModelProviderListener from the listener list that was
registered for a specific path. |
|
void |
setPresentationModel(PresentationModel newPresentationModel)
Sets the given PM instance as root node into this provider. |
|
void |
setPresentationModelType(java.lang.Class<? extends PresentationModel> newType)
Declares the type of the PM, that should be held at the root node of this provider. |
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 |
---|
public ModelProvider()
ModelProvider
.
public ModelProvider(java.lang.Class<? extends PresentationModel> presentationModelType)
ModelProvider
for the given presentationModel type.
public ModelProvider(PresentationModel presentationModel)
ModelProvider
with the given presentationModel.
Method Detail |
---|
public <T extends PresentationModel> T getPresentationModel()
IModelProvider
getPresentationModel
in interface IModelProvider
T
- the provided PM type
public void setPresentationModel(PresentationModel newPresentationModel)
setPresentationModel
in interface IModelProvider
newPresentationModel
- the PMpublic <T extends PresentationModel> T getPresentationModel(Path path)
null
if nothing is found.
getPresentationModel
in interface IModelProvider
T
- the provided PM typepath
- the path to the target PM relative to the root node held by this provider
null
if nothing was foundpublic java.lang.Class<? extends PresentationModel> getPresentationModelType()
null
.
getPresentationModelType
in interface IModelProvider
public void setPresentationModelType(java.lang.Class<? extends PresentationModel> newType)
setPresentationModelType
in interface IModelProvider
newType
- the type of the PMpublic void addModelProviderListener(Path path, ModelProviderListener l)
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.
addModelProviderListener
in interface IModelProvider
path
- the path which references the presentation modell
- the listener to addpublic void removeModelProviderListener(Path path, ModelProviderListener l)
ModelProviderListener
from the listener list that was
registered for a specific path.
removeModelProviderListener
in interface IModelProvider
path
- the path which references the presentation modell
- the listener to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |