Interface IFacade
- All Superinterfaces:
INotifier
- All Known Implementing Classes:
Facade
public interface IFacade extends INotifier
The interface definition for a PureMVC Facade.
The Facade Pattern suggests providing a single class to act as a central point of communication for a subsystem.
In PureMVC, the Facade acts as an interface between the core MVC actors (Model, View, Controller) and the rest of your application.
- See Also:
IModel,IView,IController,ICommand,INotification
-
Method Summary
Modifier and Type Method Description booleanhasCommand(java.lang.String notificationName)Check if a Command is registered for a given NotificationbooleanhasMediator(java.lang.String mediatorName)Check if a Mediator is registered or notbooleanhasProxy(java.lang.String proxyName)Check if a Proxy is registeredvoidnotifyObservers(INotification notification)Notify theIObserversfor a particularINotification.voidregisterCommand(java.lang.String notificationName, java.util.function.Supplier<ICommand> commandSupplier)Register anICommandwith theController.voidregisterMediator(IMediator mediator)Register anIMediatorinstance with theView.voidregisterProxy(IProxy proxy)Register anIProxywith theModelby name.voidremoveCommand(java.lang.String notificationName)Remove a previously registeredICommandtoINotificationmapping from the Controller.IMediatorremoveMediator(java.lang.String mediatorName)Remove aIMediatorinstance from theView.IProxyremoveProxy(java.lang.String proxyName)Remove anIProxyinstance from theModelby name.IMediatorretrieveMediator(java.lang.String mediatorName)Retrieve anIMediatorinstance from theView.IProxyretrieveProxy(java.lang.String proxyName)Retrieve aIProxyfrom theModelby name.Methods inherited from interface org.puremvc.java.interfaces.INotifier
sendNotification, sendNotification, sendNotification
-
Method Details
-
registerProxy
Register an
IProxywith theModelby name.- Parameters:
proxy- theIProxyto be registered with theModel.
-
retrieveProxy
Retrieve a
IProxyfrom theModelby name.- Parameters:
proxyName- the name of theIProxyinstance to be retrieved.- Returns:
- the
IProxypreviously regisetered byproxyNamewith theModel.
-
removeProxy
Remove an
IProxyinstance from theModelby name.- Parameters:
proxyName- theIProxyto remove from theModel.- Returns:
- the
IProxythat was removed from theModel
-
hasProxy
boolean hasProxy(java.lang.String proxyName)Check if a Proxy is registered
- Parameters:
proxyName- proxy name- Returns:
- whether a Proxy is currently registered with the given
proxyName.
-
registerCommand
void registerCommand(java.lang.String notificationName, java.util.function.Supplier<ICommand> commandSupplier)Register an
ICommandwith theController.- Parameters:
notificationName- the name of theINotificationto associate theICommandwith.commandSupplier- a reference to the Command Supplier Function of theICommand.
-
removeCommand
void removeCommand(java.lang.String notificationName)Remove a previously registered
ICommandtoINotificationmapping from the Controller.- Parameters:
notificationName- the name of theINotificationto remove theICommandmapping for
-
hasCommand
boolean hasCommand(java.lang.String notificationName)Check if a Command is registered for a given Notification
- Parameters:
notificationName- notification name- Returns:
- whether a Command is currently registered for the given
notificationName.
-
registerMediator
Register an
IMediatorinstance with theView.- Parameters:
mediator- a reference to theIMediatorinstance
-
retrieveMediator
Retrieve an
IMediatorinstance from theView.- Parameters:
mediatorName- the name of theIMediatorinstance to retrievve- Returns:
- the
IMediatorpreviously registered with the givenmediatorName.
-
removeMediator
Remove a
IMediatorinstance from theView.- Parameters:
mediatorName- name of theIMediatorinstance to be removed.- Returns:
- the
IMediatorinstance previously registered with the givenmediatorName.
-
hasMediator
boolean hasMediator(java.lang.String mediatorName)Check if a Mediator is registered or not
- Parameters:
mediatorName- mediator name- Returns:
- whether a Mediator is registered with the given
mediatorName.
-
notifyObservers
Notify the
IObserversfor a particularINotification.All previously attached
IObserversfor thisINotification's list are notified and are passed a reference to theINotificationin the order in which they were registered.NOTE: Use this method only if you are sending custom Notifications. Otherwise use the sendNotification method which does not require you to create the Notification instance.
- Parameters:
notification- theINotificationto notifyIObserversof.
-