diff --git a/README.md b/README.md index 66775c3..cb39a76 100755 --- a/README.md +++ b/README.md @@ -8,12 +8,22 @@ PureMVC is a lightweight framework for creating applications based upon the clas * [Standard Version Overview Presentation](http://puremvc.tv/#P100) * [Legacy Implementation](https://github.com/PureMVC/puremvc-java-standard-framework/tree/1.2) +## Maven Installation +```xml + + + org.puremvc + puremvc + + +``` + ## Platforms / Technologies * [Java](https://en.wikipedia.org/wiki/Java_(programming_language)) * [Android](https://en.wikipedia.org/wiki/Android_(operating_system)) ## Status -Production - [Version 2.0](https://github.com/PureMVC/puremvc-java-standard-framework/blob/master/VERSION) +Production - [Version 2.1](https://github.com/PureMVC/puremvc-java-standard-framework/blob/master/VERSION) ## License * PureMVC Standard Framework for Java - Copyright © 2019 [Saad Shams](https://www.linkedin.com/in/muizz/) diff --git a/VERSION b/VERSION index 1139f4b..4b35ef2 100755 --- a/VERSION +++ b/VERSION @@ -1,10 +1,12 @@ PureMVC Standard Framework for Java -------------------------------------------------------------------------- -Release Date: 03/07/19 +Release Date: 03/22/19 Platform: Java Version: 2 - Revision: 0 + Revision: 1 Minor: 0 Author: Saad Shams -------------------------------------------------------------------------- +2.1 - Maven Integration + 2.0 - Brand new implementation of ported code, equivalent to AS3 Standard Version 2.0.4. \ No newline at end of file diff --git a/bin/PureMVC.jar b/bin/PureMVC.jar index c0da4ba..cad1feb 100644 Binary files a/bin/PureMVC.jar and b/bin/PureMVC.jar differ diff --git a/docs/allclasses-frame.html b/docs/allclasses-frame.html index 56ae906..45cb10b 100644 --- a/docs/allclasses-frame.html +++ b/docs/allclasses-frame.html @@ -2,10 +2,10 @@ - + All Classes - + diff --git a/docs/allclasses-noframe.html b/docs/allclasses-noframe.html index dc9d17a..ac4a16d 100644 --- a/docs/allclasses-noframe.html +++ b/docs/allclasses-noframe.html @@ -2,10 +2,10 @@ - + All Classes - + diff --git a/docs/constant-values.html b/docs/constant-values.html index 75ad45a..f9c6ec9 100644 --- a/docs/constant-values.html +++ b/docs/constant-values.html @@ -2,10 +2,10 @@ - + Constant Field Values - + diff --git a/docs/help-doc.html b/docs/help-doc.html index 77dd599..5f737df 100644 --- a/docs/help-doc.html +++ b/docs/help-doc.html @@ -2,10 +2,10 @@ - + API Help - + diff --git a/docs/index-files/index-1.html b/docs/index-files/index-1.html index 5547b4f..4df6573 100644 --- a/docs/index-files/index-1.html +++ b/docs/index-files/index-1.html @@ -2,10 +2,10 @@ - + A-Index - + diff --git a/docs/index-files/index-10.html b/docs/index-files/index-10.html index bf102d7..5a6e999 100644 --- a/docs/index-files/index-10.html +++ b/docs/index-files/index-10.html @@ -2,10 +2,10 @@ - + M-Index - + diff --git a/docs/index-files/index-11.html b/docs/index-files/index-11.html index d3ff534..3d7aad7 100644 --- a/docs/index-files/index-11.html +++ b/docs/index-files/index-11.html @@ -2,10 +2,10 @@ - + N-Index - + diff --git a/docs/index-files/index-12.html b/docs/index-files/index-12.html index c5b8906..90f4215 100644 --- a/docs/index-files/index-12.html +++ b/docs/index-files/index-12.html @@ -2,10 +2,10 @@ - + O-Index - + diff --git a/docs/index-files/index-13.html b/docs/index-files/index-13.html index 3321b55..150fc90 100644 --- a/docs/index-files/index-13.html +++ b/docs/index-files/index-13.html @@ -2,10 +2,10 @@ - + P-Index - + @@ -107,7 +107,9 @@

P

A base IProxy implementation.
Proxy() - Constructor for class org.puremvc.java.patterns.proxy.Proxy
-
 
+
+
Constructor
+
Proxy(String) - Constructor for class org.puremvc.java.patterns.proxy.Proxy
Constructor
diff --git a/docs/index-files/index-14.html b/docs/index-files/index-14.html index 3c7dfcb..cbfa367 100644 --- a/docs/index-files/index-14.html +++ b/docs/index-files/index-14.html @@ -2,10 +2,10 @@ - + R-Index - + diff --git a/docs/index-files/index-15.html b/docs/index-files/index-15.html index 8acbea6..16784ed 100644 --- a/docs/index-files/index-15.html +++ b/docs/index-files/index-15.html @@ -2,10 +2,10 @@ - + S-Index - + diff --git a/docs/index-files/index-16.html b/docs/index-files/index-16.html index b9f3132..3951e4a 100644 --- a/docs/index-files/index-16.html +++ b/docs/index-files/index-16.html @@ -2,10 +2,10 @@ - + T-Index - + diff --git a/docs/index-files/index-17.html b/docs/index-files/index-17.html index 936cdc1..6842803 100644 --- a/docs/index-files/index-17.html +++ b/docs/index-files/index-17.html @@ -2,10 +2,10 @@ - + V-Index - + diff --git a/docs/index-files/index-2.html b/docs/index-files/index-2.html index f2759d7..1829605 100644 --- a/docs/index-files/index-2.html +++ b/docs/index-files/index-2.html @@ -2,10 +2,10 @@ - + C-Index - + @@ -106,7 +106,7 @@

C

 
compareNotifyContext(Object) - Method in interface org.puremvc.java.interfaces.IObserver
-
Compare the given object to the notificaiton context object.
+
Compare the given object to the notification context object.
compareNotifyContext(Object) - Method in class org.puremvc.java.patterns.observer.Observer
diff --git a/docs/index-files/index-3.html b/docs/index-files/index-3.html index 286b9c3..a6430fa 100644 --- a/docs/index-files/index-3.html +++ b/docs/index-files/index-3.html @@ -2,10 +2,10 @@ - + D-Index - + diff --git a/docs/index-files/index-4.html b/docs/index-files/index-4.html index 83ae4db..8ac93e4 100644 --- a/docs/index-files/index-4.html +++ b/docs/index-files/index-4.html @@ -2,10 +2,10 @@ - + E-Index - + diff --git a/docs/index-files/index-5.html b/docs/index-files/index-5.html index 749de98..e4703b8 100644 --- a/docs/index-files/index-5.html +++ b/docs/index-files/index-5.html @@ -2,10 +2,10 @@ - + F-Index - + diff --git a/docs/index-files/index-6.html b/docs/index-files/index-6.html index e98de74..25eab46 100644 --- a/docs/index-files/index-6.html +++ b/docs/index-files/index-6.html @@ -2,10 +2,10 @@ - + G-Index - + diff --git a/docs/index-files/index-7.html b/docs/index-files/index-7.html index ec458f5..b2b81b2 100644 --- a/docs/index-files/index-7.html +++ b/docs/index-files/index-7.html @@ -2,10 +2,10 @@ - + H-Index - + diff --git a/docs/index-files/index-8.html b/docs/index-files/index-8.html index 0b0e5a5..662881d 100644 --- a/docs/index-files/index-8.html +++ b/docs/index-files/index-8.html @@ -2,10 +2,10 @@ - + I-Index - + diff --git a/docs/index-files/index-9.html b/docs/index-files/index-9.html index 9daa45f..c5a3058 100644 --- a/docs/index-files/index-9.html +++ b/docs/index-files/index-9.html @@ -2,10 +2,10 @@ - + L-Index - + diff --git a/docs/index.html b/docs/index.html index c0b723c..fee0469 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2,7 +2,7 @@ - + Generated Documentation (Untitled) diff --git a/docs/org/puremvc/java/core/Controller.html b/docs/org/puremvc/java/core/Controller.html index 83e0993..5c69414 100644 --- a/docs/org/puremvc/java/core/Controller.html +++ b/docs/org/puremvc/java/core/Controller.html @@ -2,10 +2,10 @@ - + Controller - + @@ -145,10 +145,10 @@

Class Controller

implements IController
A Singleton IController implementation. -

- In PureMVC, the Controller class follows the + +

In PureMVC, the Controller class follows the 'Command and Controller' strategy, and assumes these - responsibilities: + responsibilities:

  • Remembering which ICommands are intended to handle which INotifications.
  • @@ -161,13 +161,13 @@

    Class Controller

    method, passing in the INotification.
-

- Your application must register ICommands with the - Controller. -

- The simplest way is to subclass Facade, + +

Your application must register ICommands with the + Controller.

+ +

The simplest way is to subclass Facade, and use its initializeController method to add your - registrations.

+ registrations.

See Also:
View, @@ -385,11 +385,10 @@

Controller

public Controller()
Constructor. -

- This IController implementation is a Singleton, +

This IController implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton - Factory method Controller.getInstance()

+ Factory method Controller.getInstance()

Throws:
java.lang.Error - Error if Singleton instance has already been constructed
@@ -413,8 +412,8 @@

Method Detail

  • executeCommand

    public void executeCommand​(INotification notification)
    -
    If an ICommand has previously been registered - to handle a the given INotification, then it is executed.
    +

    If an ICommand has previously been registered + to handle a the given INotification, then it is executed.

    Specified by:
    executeCommand in interface IController
    @@ -430,7 +429,7 @@

    executeCommand

  • getInstance

    public static IController getInstance​(java.util.function.Supplier<IController> controllerSupplier)
    -
    Controller Singleton Factory method.
    +

    Controller Singleton Factory method.

    Parameters:
    controllerSupplier - controller supplier function
    @@ -446,7 +445,7 @@

    getInstance

  • hasCommand

    public boolean hasCommand​(java.lang.String notificationName)
    -
    Check if a Command is registered for a given Notification
    +

    Check if a Command is registered for a given Notification

    Specified by:
    hasCommand in interface IController
    @@ -464,7 +463,7 @@

    hasCommand

  • initializeController

    public void initializeController()
    -
    Initialize the Singleton Controller instance. +

    Initialize the Singleton Controller instance.

    Called automatically by the constructor.

    @@ -473,13 +472,14 @@

    initializeController

    and override the initializeController method in the following way:

    - - // ensure that the Controller is talking to my IView implementation - override public function initializeController( ) : void - { - view = MyView.getInstance(() -> new MyView()); - } -
    +
    + // ensure that the Controller is talking to my IView implementation
    + override public function initializeController(  ) : void
    + {
    +     view = MyView.getInstance(() -> new MyView());
    + }
    + 
    + 
  • @@ -490,16 +490,15 @@

    initializeController

    registerCommand

    public void registerCommand​(java.lang.String notificationName,
                                 java.util.function.Supplier<ICommand> commandSupplier)
    -
    Register a particular ICommand class as the handler - for a particular INotification. +

    Register a particular ICommand class as the handler + for a particular INotification.

    -

    - If an ICommand has already been registered to +

    If an ICommand has already been registered to handle INotifications with this name, it is no longer used, the new ICommand is used instead.

    - The Observer for the new ICommand is only created if this the - first time an ICommand has been regisered for this Notification name.
    +

    The Observer for the new ICommand is only created if this the + first time an ICommand has been regisered for this Notification name.

    Specified by:
    registerCommand in interface IController
    @@ -516,7 +515,7 @@

    registerCommand

  • removeCommand

    public void removeCommand​(java.lang.String notificationName)
    -
    Remove a previously registered ICommand to INotification mapping.
    +

    Remove a previously registered ICommand to INotification mapping.

    Specified by:
    removeCommand in interface IController
    diff --git a/docs/org/puremvc/java/core/Model.html b/docs/org/puremvc/java/core/Model.html index 4e3758b..9745c5f 100644 --- a/docs/org/puremvc/java/core/Model.html +++ b/docs/org/puremvc/java/core/Model.html @@ -2,10 +2,10 @@ - + Model - + @@ -143,14 +143,12 @@

    Class Model

    public class Model
     extends java.lang.Object
     implements IModel
    -
    A Singleton IModel implementation. +

    A Singleton IModel implementation.

    -

    - In PureMVC, the Model class provides - access to model objects (Proxies) by named lookup. +

    In PureMVC, the Model class provides + access to model objects (Proxies) by named lookup.

    -

    - The Model assumes these responsibilities:

    +

    The Model assumes these responsibilities:

    • Maintain a cache of IProxy instances.
    • @@ -158,12 +156,11 @@

      Class Model

      IProxy instances.
    -

    - Your application must register IProxy instances +

    Your application must register IProxy instances with the Model. Typically, you use an ICommand to create and register IProxy instances once the Facade has initialized the Core - actors.

    + actors.

    See Also:
    Proxy, @@ -359,13 +356,12 @@

    Constructor Detail

  • Model

    public Model()
    -
    Constructor. +

    Constructor.

    -

    - This IModel implementation is a Singleton, +

    This IModel implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton - Factory method Model.getInstance()

    + Factory method Model.getInstance()

    Throws:
    java.lang.Error - Error if Singleton instance has already been constructed
    @@ -389,7 +385,7 @@

    Method Detail

  • getInstance

    public static IModel getInstance​(java.util.function.Supplier<IModel> modelSupplier)
    -
    Model Singleton Factory method.
    +

    Model Singleton Factory method.

    Parameters:
    modelSupplier - model supplier function
    @@ -405,7 +401,7 @@

    getInstance

  • hasProxy

    public boolean hasProxy​(java.lang.String proxyName)
    -
    Check if a Proxy is registered
    +

    Check if a Proxy is registered

    Specified by:
    hasProxy in interface IModel
    @@ -423,10 +419,9 @@

    hasProxy

  • initializeModel

    protected void initializeModel()
    -
    Initialize the Singleton Model instance. +

    Initialize the Singleton Model instance.

    -

    - Called automatically by the constructor, this +

    Called automatically by the constructor, this is your opportunity to initialize the Singleton instance in your subclass without overriding the constructor.

    @@ -439,7 +434,7 @@

    initializeModel

  • registerProxy

    public void registerProxy​(IProxy proxy)
    -
    Register an IProxy with the Model.
    +

    Register an IProxy with the Model.

    Specified by:
    registerProxy in interface IModel
    @@ -455,7 +450,7 @@

    registerProxy

  • removeProxy

    public IProxy removeProxy​(java.lang.String proxyName)
    -
    Remove an IProxy from the Model.
    +

    Remove an IProxy from the Model.

    Specified by:
    removeProxy in interface IModel
    @@ -473,7 +468,7 @@

    removeProxy

  • retrieveProxy

    public IProxy retrieveProxy​(java.lang.String proxyName)
    -
    Retrieve an IProxy from the Model.
    +

    Retrieve an IProxy from the Model.

    Specified by:
    retrieveProxy in interface IModel
    diff --git a/docs/org/puremvc/java/core/View.html b/docs/org/puremvc/java/core/View.html index 229a4e0..871e9de 100644 --- a/docs/org/puremvc/java/core/View.html +++ b/docs/org/puremvc/java/core/View.html @@ -2,10 +2,10 @@ - + View - + @@ -143,10 +143,10 @@

    Class View

    public class View
     extends java.lang.Object
     implements IView
    -
    A Singleton IView implementation. +

    A Singleton IView implementation.

    + +

    In PureMVC, the View class assumes these responsibilities:

    -

    - In PureMVC, the View class assumes these responsibilities:

    • Maintain a cache of IMediator instances.
    • Provide methods for registering, retrieving, and removing IMediators.
    • @@ -390,13 +390,12 @@

      Constructor Detail

    • View

      public View()
      -
      Constructor. +

      Constructor.

      -

      - This IView implementation is a Singleton, +

      This IView implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton - Factory method View.getInstance()

      + Factory method View.getInstance()

      Throws:
      java.lang.Error - Error if Singleton instance has already been constructed
      @@ -420,7 +419,7 @@

      Method Detail

    • getInstance

      public static IView getInstance​(java.util.function.Supplier<IView> viewSupplier)
      -
      View Singleton Factory method.
      +

      View Singleton Factory method.

      Parameters:
      viewSupplier - view supplier function
      @@ -436,7 +435,7 @@

      getInstance

    • hasMediator

      public boolean hasMediator​(java.lang.String mediatorName)
      -
      Check if a Mediator is registered or not
      +

      Check if a Mediator is registered or not

      Specified by:
      hasMediator in interface IView
      @@ -454,10 +453,9 @@

      hasMediator

    • initializeView

      protected void initializeView()
      -
      Initialize the Singleton View instance. +

      Initialize the Singleton View instance.

      -

      - Called automatically by the constructor, this +

      Called automatically by the constructor, this is your opportunity to initialize the Singleton instance in your subclass without overriding the constructor.

      @@ -470,10 +468,9 @@

      initializeView

    • notifyObservers

      public void notifyObservers​(INotification notification)
      -
      Notify the IObservers for a particular INotification. +

      Notify the IObservers for a particular INotification.

      -

      - All previously attached IObservers for this INotification's +

      All previously attached IObservers for this INotification's list are notified and are passed a reference to the INotification in the order in which they were registered.

      @@ -491,18 +488,17 @@

      notifyObservers

    • registerMediator

      public void registerMediator​(IMediator mediator)
      -
      Register an IMediator instance with the View. +

      Register an IMediator instance with the View.

      -

      - Registers the IMediator so that it can be retrieved by name, +

      Registers the IMediator so that it can be retrieved by name, and further interrogates the IMediator for its INotification interests.

      -

      - If the IMediator returns any INotification + +

      If the IMediator returns any INotification names to be notified about, an Observer is created encapsulating the IMediator instance's handleNotification method and registering it as an Observer for all INotifications the - IMediator is interested in.

      + IMediator is interested in.

      Specified by:
      registerMediator in interface IView
      @@ -519,8 +515,8 @@

      registerMediator

      registerObserver

      public void registerObserver​(java.lang.String notificationName,
                                    IObserver observer)
      -
      Register an IObserver to be notified - of INotifications with a given name.
      +

      Register an IObserver to be notified + of INotifications with a given name.

      Specified by:
      registerObserver in interface IView
      @@ -537,7 +533,7 @@

      registerObserver

    • removeMediator

      public IMediator removeMediator​(java.lang.String mediatorName)
      -
      Remove an IMediator from the View.
      +

      Remove an IMediator from the View.

      Specified by:
      removeMediator in interface IView
      @@ -556,8 +552,7 @@

      removeMediator

      removeObserver

      public void removeObserver​(java.lang.String notificationName,
                                  java.lang.Object notifyContext)
      -
      Remove the observer for a given notifyContext from an observer list for a given Notification name. -

      +

      Remove the observer for a given notifyContext from an observer list for a given Notification name.

      Specified by:
      removeObserver in interface IView
      @@ -574,7 +569,7 @@

      removeObserver

    • retrieveMediator

      public IMediator retrieveMediator​(java.lang.String mediatorName)
      -
      Retrieve an IMediator from the View.
      +

      Retrieve an IMediator from the View.

      Specified by:
      retrieveMediator in interface IView
      diff --git a/docs/org/puremvc/java/core/package-frame.html b/docs/org/puremvc/java/core/package-frame.html index c0fae0f..5edb9ca 100644 --- a/docs/org/puremvc/java/core/package-frame.html +++ b/docs/org/puremvc/java/core/package-frame.html @@ -2,10 +2,10 @@ - + org.puremvc.java.core - + diff --git a/docs/org/puremvc/java/core/package-summary.html b/docs/org/puremvc/java/core/package-summary.html index ad296c1..733db30 100644 --- a/docs/org/puremvc/java/core/package-summary.html +++ b/docs/org/puremvc/java/core/package-summary.html @@ -2,10 +2,10 @@ - + org.puremvc.java.core - + diff --git a/docs/org/puremvc/java/core/package-tree.html b/docs/org/puremvc/java/core/package-tree.html index f2a8346..e5ec86a 100644 --- a/docs/org/puremvc/java/core/package-tree.html +++ b/docs/org/puremvc/java/core/package-tree.html @@ -2,10 +2,10 @@ - + org.puremvc.java.core Class Hierarchy - + diff --git a/docs/org/puremvc/java/interfaces/ICommand.html b/docs/org/puremvc/java/interfaces/ICommand.html index dde6685..75a3a4c 100644 --- a/docs/org/puremvc/java/interfaces/ICommand.html +++ b/docs/org/puremvc/java/interfaces/ICommand.html @@ -2,10 +2,10 @@ - + ICommand - + @@ -201,7 +201,7 @@

      Method Detail

    • execute

      void execute​(INotification notification)
      -
      Execute the ICommand's logic to handle a given INotification.
      +

      Execute the ICommand's logic to handle a given INotification.

      Parameters:
      notification - an INotification to handle.
      diff --git a/docs/org/puremvc/java/interfaces/IController.html b/docs/org/puremvc/java/interfaces/IController.html index aa4c262..f42cd18 100644 --- a/docs/org/puremvc/java/interfaces/IController.html +++ b/docs/org/puremvc/java/interfaces/IController.html @@ -2,10 +2,10 @@ - + IController - + @@ -133,12 +133,12 @@

      Interface IController


      public interface IController
      -
      The interface definition for a PureMVC Controller. +

      The interface definition for a PureMVC Controller.

      -

      - In PureMVC, an IController implementor +

      In PureMVC, an IController implementor follows the 'Command and Controller' strategy, and - assumes these responsibilities: + assumes these responsibilities:

      +
      • Remembering which ICommands are intended to handle which INotifications.
      • @@ -230,8 +230,8 @@

        Method Detail

      • executeCommand

        void executeCommand​(INotification notification)
        -
        Execute the ICommand previously registered as the - handler for INotifications with the given notification name.
        +

        Execute the ICommand previously registered as the + handler for INotifications with the given notification name.

        Parameters:
        notification - the INotification to execute the associated ICommand for
        @@ -245,7 +245,7 @@

        executeCommand

      • hasCommand

        boolean hasCommand​(java.lang.String notificationName)
        -
        Check if a Command is registered for a given Notification
        +

        Check if a Command is registered for a given Notification

        Parameters:
        notificationName - notification name
        @@ -262,8 +262,8 @@

        hasCommand

        registerCommand

        void registerCommand​(java.lang.String notificationName,
                              java.util.function.Supplier<ICommand> commandSupplier)
        -
        Register a particular ICommand class as the handler - for a particular INotification.
        +

        Register a particular ICommand class as the handler + for a particular INotification.

        Parameters:
        notificationName - the name of the INotification
        @@ -278,7 +278,7 @@

        registerCommand

      • removeCommand

        void removeCommand​(java.lang.String notificationName)
        -
        Remove a previously registered ICommand to INotification mapping.
        +

        Remove a previously registered ICommand to INotification mapping.

        Parameters:
        notificationName - the name of the INotification to remove the ICommand mapping for
        diff --git a/docs/org/puremvc/java/interfaces/IFacade.html b/docs/org/puremvc/java/interfaces/IFacade.html index 8c1d590..fece358 100644 --- a/docs/org/puremvc/java/interfaces/IFacade.html +++ b/docs/org/puremvc/java/interfaces/IFacade.html @@ -2,10 +2,10 @@ - + IFacade - + @@ -138,15 +138,13 @@

        Interface IFacade


        public interface IFacade
         extends INotifier
        -
        The interface definition for a PureMVC Facade. +

        The interface definition for a PureMVC Facade.

        -

        - The Facade Pattern suggests providing a single +

        The Facade Pattern suggests providing a single class to act as a central point of communication - for a subsystem.

        + for a subsystem.

        -

        - In PureMVC, the Facade acts as an interface between +

        In PureMVC, the Facade acts as an interface between the core MVC actors (Model, View, Controller) and the rest of your application.

        @@ -293,7 +291,7 @@

        Method Detail

      • hasCommand

        boolean hasCommand​(java.lang.String notificationName)
        -
        Check if a Command is registered for a given Notification
        +

        Check if a Command is registered for a given Notification

        Parameters:
        notificationName - notification name
        @@ -309,7 +307,7 @@

        hasCommand

      • hasMediator

        boolean hasMediator​(java.lang.String mediatorName)
        -
        Check if a Mediator is registered or not
        +

        Check if a Mediator is registered or not

        Parameters:
        mediatorName - mediator name
        @@ -325,7 +323,7 @@

        hasMediator

      • hasProxy

        boolean hasProxy​(java.lang.String proxyName)
        -
        Check if a Proxy is registered
        +

        Check if a Proxy is registered

        Parameters:
        proxyName - proxy name
        @@ -341,14 +339,13 @@

        hasProxy

      • notifyObservers

        void notifyObservers​(INotification notification)
        -
        Notify the IObservers for a particular INotification. +

        Notify the IObservers for a particular INotification.

        -

        - All previously attached IObservers for this INotification's +

        All previously attached IObservers for this INotification's list are notified and are passed a reference to the INotification in the order in which they were registered.

        -

        - NOTE: Use this method only if you are sending custom Notifications. Otherwise + +

        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.

        @@ -365,7 +362,7 @@

        notifyObservers

        registerCommand

        void registerCommand​(java.lang.String notificationName,
                              java.util.function.Supplier<ICommand> commandSupplier)
        -
        Register an ICommand with the Controller.
        +

        Register an ICommand with the Controller.

        Parameters:
        notificationName - the name of the INotification to associate the ICommand with.
        @@ -380,7 +377,7 @@

        registerCommand

      • registerMediator

        void registerMediator​(IMediator mediator)
        -
        Register an IMediator instance with the View.
        +

        Register an IMediator instance with the View.

        Parameters:
        mediator - a reference to the IMediator instance
        @@ -394,7 +391,7 @@

        registerMediator

      • registerProxy

        void registerProxy​(IProxy proxy)
        -
        Register an IProxy with the Model by name.
        +

        Register an IProxy with the Model by name.

        Parameters:
        proxy - the IProxy to be registered with the Model.
        @@ -408,7 +405,7 @@

        registerProxy

      • removeCommand

        void removeCommand​(java.lang.String notificationName)
        -
        Remove a previously registered ICommand to INotification mapping from the Controller.
        +

        Remove a previously registered ICommand to INotification mapping from the Controller.

        Parameters:
        notificationName - the name of the INotification to remove the ICommand mapping for
        @@ -422,7 +419,7 @@

        removeCommand

      • removeMediator

        IMediator removeMediator​(java.lang.String mediatorName)
        -
        Remove a IMediator instance from the View.
        +

        Remove a IMediator instance from the View.

        Parameters:
        mediatorName - name of the IMediator instance to be removed.
        @@ -438,7 +435,7 @@

        removeMediator

      • removeProxy

        IProxy removeProxy​(java.lang.String proxyName)
        -
        Remove an IProxy instance from the Model by name.
        +

        Remove an IProxy instance from the Model by name.

        Parameters:
        proxyName - the IProxy to remove from the Model.
        @@ -454,7 +451,7 @@

        removeProxy

      • retrieveMediator

        IMediator retrieveMediator​(java.lang.String mediatorName)
        -
        Retrieve an IMediator instance from the View.
        +

        Retrieve an IMediator instance from the View.

        Parameters:
        mediatorName - the name of the IMediator instance to retrievve
        @@ -470,7 +467,7 @@

        retrieveMediator

      • retrieveProxy

        IProxy retrieveProxy​(java.lang.String proxyName)
        -
        Retrieve a IProxy from the Model by name.
        +

        Retrieve a IProxy from the Model by name.

        Parameters:
        proxyName - the name of the IProxy instance to be retrieved.
        diff --git a/docs/org/puremvc/java/interfaces/IMediator.html b/docs/org/puremvc/java/interfaces/IMediator.html index 00d7b4f..72becd0 100644 --- a/docs/org/puremvc/java/interfaces/IMediator.html +++ b/docs/org/puremvc/java/interfaces/IMediator.html @@ -2,10 +2,10 @@ - + IMediator - + @@ -138,96 +138,93 @@

        Interface IMediator


        public interface IMediator
         extends INotifier
        -
        The interface definition for a PureMVC Mediator. +

        The interface definition for a PureMVC Mediator.

        + +

        In PureMVC, IMediator implementors assume these responsibilities:

        -

        - In PureMVC, IMediator implementors assume these responsibilities:

        • Implement a common method which returns a list of all INotifications the IMediator has interest in.
        • Implement a notification callback method.
        • Implement methods that are called when the IMediator is registered or removed from the View.
        -

        - Additionally, IMediators typically: -

        + +

        Additionally, IMediators typically:

        +
        • Act as an intermediary between one or more view components such as text boxes or list controls, maintaining references and coordinating their behavior.
        • In Flash-based apps, this is often the place where event listeners are added to view components, and their handlers implemented.
        • Respond to and generate INotifications, interacting with of - the rest of the PureMVC app. + the rest of the PureMVC app.
        -

        - When an IMediator is registered with the IView, + +

        When an IMediator is registered with the IView, the IView will call the IMediator's listNotificationInterests method. The IMediator will return an Array of INotification names which it wishes to be notified about.

        -

        - The IView will then create an Observer object +

        The IView will then create an Observer object encapsulating that IMediator's (handleNotification) method and register it as an Observer for each INotification name returned by listNotificationInterests.

        -

        - A concrete IMediator implementor usually looks something like this:

        +

        A concrete IMediator implementor usually looks something like this:

        - 
        -	import org.puremvc.as3.multicore.patterns.mediator.*;
        -	import org.puremvc.as3.multicore.patterns.observer.*;
        -	import org.puremvc.as3.multicore.core.view.*;
        + import org.puremvc.as3.multicore.patterns.mediator.*;
        + import org.puremvc.as3.multicore.patterns.observer.*;
        + import org.puremvc.as3.multicore.core.view.*;
         
        -	import com.me.myapp.model.*;
        -	import com.me.myapp.view.*;
        -	import com.me.myapp.controller.*;
        + import com.me.myapp.model.*;
        + import com.me.myapp.view.*;
        + import com.me.myapp.controller.*;
         
        -	import javax.swing.JComboBox;
        -	import java.awt.event.ActionListener;
        + import javax.swing.JComboBox;
        + import java.awt.event.ActionListener;
         
        -        public class MyMediator extends Mediator implements IMediator, ActionListener {
        + public class MyMediator extends Mediator implements IMediator, ActionListener {
         
        - 		public MyMediator( Object viewComponent ) {
        - 			super( viewComponent );
        - 			combo.addActionListener( this );
        - 		}
        +     public MyMediator( Object viewComponent ) {
        +         super( viewComponent );
        +         combo.addActionListener( this );
        +     }
         
        - 		public String[] listNotificationInterests() {
        - 			return [ MyFacade.SET_SELECTION,
        - 						 MyFacade.SET_DATAPROVIDER ];
        - 		}
        +     public String[] listNotificationInterests() {
        +         return [ MyFacade.SET_SELECTION,
        +                  MyFacade.SET_DATAPROVIDER ];
        +     }
         
        - 		public void handleNotification( INotification notification ) {
        -  			switch ( notification.getName() ) {
        - 			        case MyFacade.SET_SELECTION:
        - 			          setSelection(notification);
        - 			          break;
        - 			        case MyFacade.SET_DATAPROVIDER:
        - 			          setDataProvider(notification);
        - 			          break;
        -  			}
        - 		}
        +     public void handleNotification( INotification notification ) {
        +         switch ( notification.getName() ) {
        +             case MyFacade.SET_SELECTION:
        +                 setSelection(notification);
        +                 break;
        +             case MyFacade.SET_DATAPROVIDER:
        +                 setDataProvider(notification);
        +                 break;
        +         }
        +     }
         
        - 		// Set the data provider of the combo box
        - 		protected void setDataProvider( INotification notification ) {
        - 			combo.setModel(ComboBoxModel<String>(notification.getBody()));
        - 		}
        +     // Set the data provider of the combo box
        +     protected void setDataProvider( INotification notification ) {
        +         combo.setModel(ComboBoxModel<String>(notification.getBody()));
        +     }
         
        - 		// Invoked when the combo box dispatches a change event, we send a
        - 		// notification with the
        - 		public void actionPerformed(ActionEvent event) {
        - 			sendNotification( MyFacade.MYCOMBO_CHANGED, this );
        - 		}
        +     // Invoked when the combo box dispatches a change event, we send a
        +     // notification with the
        +     public void actionPerformed(ActionEvent event) {
        +         sendNotification( MyFacade.MYCOMBO_CHANGED, this );
        +     }
         
        - 		// A private getter for accessing the view object by class
        - 		protected JComboBox getViewComponent() {
        - 			return viewComponent;
        - 		}
        +     // A private getter for accessing the view object by class
        +     protected JComboBox getViewComponent() {
        +         return viewComponent;
        +     }
         
        -        }
        + }
          
          
        @@ -334,7 +331,7 @@

        Method Detail

      • getMediatorName

        java.lang.String getMediatorName()
        -
        Get the IMediator instance name
        +

        Get the IMediator instance name

        Returns:
        the IMediator instance name
        @@ -348,7 +345,7 @@

        getMediatorName

      • getViewComponent

        java.lang.Object getViewComponent()
        -
        Get the IMediator's view component.
        +

        Get the IMediator's view component.

        Returns:
        Object the view component
        @@ -362,7 +359,7 @@

        getViewComponent

      • handleNotification

        void handleNotification​(INotification notification)
        -
        Handle an INotification.
        +

        Handle an INotification.

        Parameters:
        notification - the INotification to be handled
        @@ -376,7 +373,7 @@

        handleNotification

      • listNotificationInterests

        java.lang.String[] listNotificationInterests()
        -
        List INotification interests.
        +

        List INotification interests.

        Returns:
        an Array of the INotification names this IMediator has an interest in.
        @@ -390,7 +387,7 @@

        listNotificationInterests

      • onRegister

        void onRegister()
        -
        Called by the View when the Mediator is registered
        +

        Called by the View when the Mediator is registered

      @@ -400,7 +397,7 @@

      onRegister

    • onRemove

      void onRemove()
      -
      Called by the View when the Mediator is removed
      +

      Called by the View when the Mediator is removed

    @@ -410,7 +407,7 @@

    onRemove

  • setViewComponent

    void setViewComponent​(java.lang.Object viewComponent)
    -
    Set the IMediator's view component.
    +

    Set the IMediator's view component.

    Parameters:
    viewComponent - the view component
    diff --git a/docs/org/puremvc/java/interfaces/IModel.html b/docs/org/puremvc/java/interfaces/IModel.html index 2615802..888b67f 100644 --- a/docs/org/puremvc/java/interfaces/IModel.html +++ b/docs/org/puremvc/java/interfaces/IModel.html @@ -2,10 +2,10 @@ - + IModel - + @@ -133,14 +133,12 @@

    Interface IModel


    public interface IModel
    -
    The interface definition for a PureMVC Model. +

    The interface definition for a PureMVC Model.

    -

    - In PureMVC, IModel implementors provide +

    In PureMVC, IModel implementors provide access to IProxy objects by named lookup.

    -

    - An IModel assumes these responsibilities:

    +

    An IModel assumes these responsibilities:

    • Maintain a cache of IProxy instances
    • @@ -218,7 +216,7 @@

      Method Detail

    • hasProxy

      boolean hasProxy​(java.lang.String proxyName)
      -
      Check if a Proxy is registered
      +

      Check if a Proxy is registered

      Parameters:
      proxyName - proxy name
      @@ -234,7 +232,7 @@

      hasProxy

    • registerProxy

      void registerProxy​(IProxy proxy)
      -
      Register an IProxy instance with the Model.
      +

      Register an IProxy instance with the Model.

      Parameters:
      proxy - an object reference to be held by the Model.
      @@ -248,7 +246,7 @@

      registerProxy

    • removeProxy

      IProxy removeProxy​(java.lang.String proxyName)
      -
      Remove an IProxy instance from the Model.
      +

      Remove an IProxy instance from the Model.

      Parameters:
      proxyName - name of the IProxy instance to be removed.
      @@ -264,7 +262,7 @@

      removeProxy

    • retrieveProxy

      IProxy retrieveProxy​(java.lang.String proxyName)
      -
      Retrieve an IProxy instance from the Model.
      +

      Retrieve an IProxy instance from the Model.

      Parameters:
      proxyName - proxy name
      diff --git a/docs/org/puremvc/java/interfaces/INotification.html b/docs/org/puremvc/java/interfaces/INotification.html index d3486e9..8bb8632 100644 --- a/docs/org/puremvc/java/interfaces/INotification.html +++ b/docs/org/puremvc/java/interfaces/INotification.html @@ -2,10 +2,10 @@ - + INotification - + @@ -133,20 +133,17 @@

      Interface INotification


      public interface INotification
      -
      The interface definition for a PureMVC Notification. +

      The interface definition for a PureMVC Notification.

      -

      - PureMVC does not rely upon underlying event models such +

      PureMVC does not rely upon underlying event models such as the one provided with Flash, and ActionScript 3 does not have an inherent event model.

      -

      - The Observer Pattern as implemented within PureMVC exists +

      The Observer Pattern as implemented within PureMVC exists to support event-driven communication between the application and the actors of the MVC triad.

      -

      - Notifications are not meant to be a replacement for Events +

      Notifications are not meant to be a replacement for Events in Flex/Flash/AIR. Generally, IMediator implementors place event listeners on their view components, which they then handle in the usual way. This may lead to the broadcast of Notifications to @@ -154,15 +151,14 @@

      Interface INotification

      instances communicate with each other and IMediators by broadcasting INotifications.

      -

      - A key difference between Flash Events and PureMVC +

      A key difference between Flash Events and PureMVC Notifications is that Events follow the 'Chain of Responsibility' pattern, 'bubbling' up the display hierarchy until some parent component handles the Event, while PureMVC Notifications follow a 'Publish/Subscribe' pattern. PureMVC classes need not be related to each other in a parent/child relationship in order to communicate with one another - using Notifications.

      + using Notifications.

      See Also:
      IView, @@ -254,7 +250,7 @@

      Method Detail

    • getBody

      java.lang.Object getBody()
      -
      Get the body of the INotification instance
      +

      Get the body of the INotification instance

      Returns:
      notification body
      @@ -268,8 +264,8 @@

      getBody

    • getName

      java.lang.String getName()
      -
      Get the name of the INotification instance. - No setter, should be set by constructor only
      +

      Get the name of the INotification instance. + No setter, should be set by constructor only

      Returns:
      notification name
      @@ -283,7 +279,7 @@

      getName

    • getType

      java.lang.String getType()
      -
      Get the type of the INotification instance
      +

      Get the type of the INotification instance

      Returns:
      notification type
      @@ -297,7 +293,7 @@

      getType

    • setBody

      void setBody​(java.lang.Object body)
      -
      Set the body of the INotification instance
      +

      Set the body of the INotification instance

      Parameters:
      body - notification body
      @@ -311,7 +307,7 @@

      setBody

    • setType

      void setType​(java.lang.String type)
      -
      Set the type of the INotification instance
      +

      Set the type of the INotification instance

      Parameters:
      type - notification type
      @@ -325,7 +321,7 @@

      setType

    • toString

      java.lang.String toString()
      -
      Get the string representation of the INotification instance
      +

      Get the string representation of the INotification instance

      Overrides:
      toString in class java.lang.Object
      diff --git a/docs/org/puremvc/java/interfaces/INotifier.html b/docs/org/puremvc/java/interfaces/INotifier.html index 7ade543..d7b1ba7 100644 --- a/docs/org/puremvc/java/interfaces/INotifier.html +++ b/docs/org/puremvc/java/interfaces/INotifier.html @@ -2,10 +2,10 @@ - + INotifier - + @@ -137,19 +137,16 @@

      Interface INotifier


      public interface INotifier
      -
      The interface definition for a PureMVC Notifier. +

      The interface definition for a PureMVC Notifier.

      -

      - MacroCommand, Command, Mediator and Proxy - all have a need to send Notifications.

      +

      MacroCommand, Command, Mediator and Proxy + all have a need to send Notifications.

      -

      - The INotifier interface provides a common method called +

      The INotifier interface provides a common method called sendNotification that relieves implementation code of the necessity to actually construct Notifications.

      -

      - The Notifier class, which all of the above mentioned classes +

      The Notifier class, which all of the above mentioned classes extend, also provides an initialized reference to the Facade Singleton, which is required for the convienience method for sending Notifications, but also eases implementation as these @@ -228,10 +225,9 @@

      Method Detail

    • sendNotification

      void sendNotification​(java.lang.String notificationName)
      -
      Send a INotification. +

      Send a INotification.

      -

      - Convenience method to prevent having to construct new +

      Convenience method to prevent having to construct new notification instances in our implementation code.

      Parameters:
      @@ -247,10 +243,9 @@

      sendNotification

      sendNotification

      void sendNotification​(java.lang.String notificationName,
                             java.lang.Object body)
      -
      Send a INotification. +

      Send a INotification.

      -

      - Convenience method to prevent having to construct new +

      Convenience method to prevent having to construct new notification instances in our implementation code.

      Parameters:
      @@ -268,10 +263,9 @@

      sendNotification

      void sendNotification​(java.lang.String notificationName,
                             java.lang.Object body,
                             java.lang.String type)
      -
      Send a INotification. +

      Send a INotification.

      -

      - Convenience method to prevent having to construct new +

      Convenience method to prevent having to construct new notification instances in our implementation code.

      Parameters:
      diff --git a/docs/org/puremvc/java/interfaces/IObserver.html b/docs/org/puremvc/java/interfaces/IObserver.html index 9c7cb28..83782ff 100644 --- a/docs/org/puremvc/java/interfaces/IObserver.html +++ b/docs/org/puremvc/java/interfaces/IObserver.html @@ -2,10 +2,10 @@ - + IObserver - + @@ -133,10 +133,10 @@

      Interface IObserver


      public interface IObserver
      -
      The interface definition for a PureMVC Observer. +

      The interface definition for a PureMVC Observer.

      + +

      In PureMVC, IObserver implementors assume these responsibilities:

      -

      - In PureMVC, IObserver implementors assume these responsibilities:

      • Encapsulate the notification (callback) method of the interested object.
      • Encapsulate the notification context (this) of the interested object.
      • @@ -144,26 +144,22 @@

        Interface IObserver

      • Provide a method for notifying the interested object.
      -

      - PureMVC does not rely upon underlying event +

      PureMVC does not rely upon underlying event models such as the one provided with Flash, and ActionScript 3 does not have an inherent event model.

      -

      - The Observer Pattern as implemented within +

      The Observer Pattern as implemented within PureMVC exists to support event driven communication between the application and the actors of the MVC triad.

      -

      - An Observer is an object that encapsulates information +

      An Observer is an object that encapsulates information about an interested object with a notification method that should be called when an INotification is broadcast. The Observer then - acts as a proxy for notifying the interested object. + acts as a proxy for notifying the interested object.

      -

      - Observers can receive Notifications by having their +

      Observers can receive Notifications by having their notifyObserver method invoked, passing in an object implementing the INotification interface, such as a subclass of Notification.

      @@ -196,7 +192,7 @@

      Method Summary

      boolean compareNotifyContext​(java.lang.Object object) -
      Compare the given object to the notificaiton context object.
      +
      Compare the given object to the notification context object.
      @@ -244,7 +240,7 @@

      Method Detail

    • compareNotifyContext

      boolean compareNotifyContext​(java.lang.Object object)
      -
      Compare the given object to the notificaiton context object.
      +

      Compare the given object to the notification context object.

      Parameters:
      object - the object to compare.
      @@ -260,7 +256,7 @@

      compareNotifyContext

    • notifyObserver

      void notifyObserver​(INotification notification)
      -
      Notify the interested object.
      +

      Notify the interested object.

      Parameters:
      notification - the INotification to pass to the interested object's notification method
      @@ -274,7 +270,7 @@

      notifyObserver

    • setNotifyContext

      void setNotifyContext​(java.lang.Object notifyContext)
      -
      Set the notification context.
      +

      Set the notification context.

      Parameters:
      notifyContext - the notification context (this) of the interested object
      @@ -288,10 +284,9 @@

      setNotifyContext

    • setNotifyMethod

      void setNotifyMethod​(java.util.function.Consumer<INotification> notifyMethod)
      -
      Set the notification method. +

      Set the notification method.

      -

      - The notification method should take one parameter of type INotification

      +

      The notification method should take one parameter of type INotification

      Parameters:
      notifyMethod - the notification (callback) method of the interested object
      diff --git a/docs/org/puremvc/java/interfaces/IProxy.html b/docs/org/puremvc/java/interfaces/IProxy.html index b66b0fe..4faf40d 100644 --- a/docs/org/puremvc/java/interfaces/IProxy.html +++ b/docs/org/puremvc/java/interfaces/IProxy.html @@ -2,10 +2,10 @@ - + IProxy - + @@ -138,16 +138,17 @@

      Interface IProxy


      public interface IProxy
       extends INotifier
      -
      The interface definition for a PureMVC Proxy. +

      The interface definition for a PureMVC Proxy.

      + +

      In PureMVC, IProxy implementors assume these responsibilities:

      -

      - In PureMVC, IProxy implementors assume these responsibilities:

      • Implement a common method which returns the name of the Proxy.
      • Provide methods for setting and getting the data object.
      -

      - Additionally, IProxys typically:

      + +

      Additionally, IProxys typically:

      +
      • Maintain references to one or more pieces of model data.
      • Provide methods for manipulating that data.
      • @@ -241,7 +242,7 @@

        Method Detail

      • getData

        java.lang.Object getData()
        -
        Get the data object
        +

        Get the data object

        Returns:
        the data as type Object
        @@ -255,7 +256,7 @@

        getData

      • getProxyName

        java.lang.String getProxyName()
        -
        Get the Proxy name
        +

        Get the Proxy name

        Returns:
        the Proxy instance name
        @@ -269,7 +270,7 @@

        getProxyName

      • onRegister

        void onRegister()
        -
        Called by the Model when the Proxy is registered
        +

        Called by the Model when the Proxy is registered

      @@ -279,7 +280,7 @@

      onRegister

    • onRemove

      void onRemove()
      -
      Called by the Model when the Proxy is removed
      +

      Called by the Model when the Proxy is removed

    @@ -289,7 +290,7 @@

    onRemove

  • setData

    void setData​(java.lang.Object data)
    -
    Set the data object
    +

    Set the data object

    Parameters:
    data - the data object
    diff --git a/docs/org/puremvc/java/interfaces/IView.html b/docs/org/puremvc/java/interfaces/IView.html index d96600d..605ef50 100644 --- a/docs/org/puremvc/java/interfaces/IView.html +++ b/docs/org/puremvc/java/interfaces/IView.html @@ -2,10 +2,10 @@ - + IView - + @@ -133,13 +133,12 @@

    Interface IView


    public interface IView
    -
    The interface definition for a PureMVC View. +

    The interface definition for a PureMVC View.

    -

    - In PureMVC, IView implementors assume these responsibilities:

    +

    In PureMVC, IView implementors assume these responsibilities:

    + +

    In PureMVC, the View class assumes these responsibilities:

    -

    - In PureMVC, the View class assumes these responsibilities:

    • Maintain a cache of IMediator instances.
    • Provide methods for registering, retrieving, and removing IMediators.
    • @@ -250,7 +249,7 @@

      Method Detail

    • hasMediator

      boolean hasMediator​(java.lang.String mediatorName)
      -
      Check if a Mediator is registered or not
      +

      Check if a Mediator is registered or not

      Parameters:
      mediatorName - mediator name
      @@ -266,10 +265,9 @@

      hasMediator

    • notifyObservers

      void notifyObservers​(INotification notification)
      -
      Notify the IObservers for a particular INotification. +

      Notify the IObservers for a particular INotification.

      -

      - All previously attached IObservers for this INotification's +

      All previously attached IObservers for this INotification's list are notified and are passed a reference to the INotification in the order in which they were registered.

      @@ -285,14 +283,13 @@

      notifyObservers

    • registerMediator

      void registerMediator​(IMediator mediator)
      -
      Register an IMediator instance with the View. +

      Register an IMediator instance with the View.

      -

      - Registers the IMediator so that it can be retrieved by name, +

      Registers the IMediator so that it can be retrieved by name, and further interrogates the IMediator for its INotification interests.

      -

      - If the IMediator returns any INotification + +

      If the IMediator returns any INotification names to be notified about, an Observer is created encapsulating the IMediator instance's handleNotification method and registering it as an Observer for all INotifications the @@ -311,8 +308,8 @@

      registerMediator

      registerObserver

      void registerObserver​(java.lang.String notificationName,
                             IObserver observer)
      -
      Register an IObserver to be notified - of INotifications with a given name.
      +

      Register an IObserver to be notified + of INotifications with a given name.

      Parameters:
      notificationName - the name of the INotifications to notify this IObserver of
      @@ -327,7 +324,7 @@

      registerObserver

    • removeMediator

      IMediator removeMediator​(java.lang.String mediatorName)
      -
      Remove an IMediator from the View.
      +

      Remove an IMediator from the View.

      Parameters:
      mediatorName - name of the IMediator instance to be removed.
      @@ -344,8 +341,7 @@

      removeMediator

      removeObserver

      void removeObserver​(java.lang.String notificationName,
                           java.lang.Object notifyContext)
      -
      Remove a group of observers from the observer list for a given Notification name. -

      +

      Remove a group of observers from the observer list for a given Notification name.

      Parameters:
      notificationName - which observer list to remove from
      @@ -360,7 +356,7 @@

      removeObserver

    • retrieveMediator

      IMediator retrieveMediator​(java.lang.String mediatorName)
      -
      Retrieve an IMediator from the View.
      +

      Retrieve an IMediator from the View.

      Parameters:
      mediatorName - the name of the IMediator instance to retrieve.
      diff --git a/docs/org/puremvc/java/interfaces/package-frame.html b/docs/org/puremvc/java/interfaces/package-frame.html index 4e37922..1f4479a 100644 --- a/docs/org/puremvc/java/interfaces/package-frame.html +++ b/docs/org/puremvc/java/interfaces/package-frame.html @@ -2,10 +2,10 @@ - + org.puremvc.java.interfaces - + diff --git a/docs/org/puremvc/java/interfaces/package-summary.html b/docs/org/puremvc/java/interfaces/package-summary.html index fc3dca3..c70aa98 100644 --- a/docs/org/puremvc/java/interfaces/package-summary.html +++ b/docs/org/puremvc/java/interfaces/package-summary.html @@ -2,10 +2,10 @@ - + org.puremvc.java.interfaces - + diff --git a/docs/org/puremvc/java/interfaces/package-tree.html b/docs/org/puremvc/java/interfaces/package-tree.html index d8dfff5..c182ee8 100644 --- a/docs/org/puremvc/java/interfaces/package-tree.html +++ b/docs/org/puremvc/java/interfaces/package-tree.html @@ -2,10 +2,10 @@ - + org.puremvc.java.interfaces Class Hierarchy - + diff --git a/docs/org/puremvc/java/patterns/command/MacroCommand.html b/docs/org/puremvc/java/patterns/command/MacroCommand.html index 860976c..38603b4 100644 --- a/docs/org/puremvc/java/patterns/command/MacroCommand.html +++ b/docs/org/puremvc/java/patterns/command/MacroCommand.html @@ -2,10 +2,10 @@ - + MacroCommand - + @@ -148,27 +148,22 @@

      Class MacroCommand

      public class MacroCommand
       extends Notifier
       implements ICommand
      -
      A base ICommand implementation that executes other ICommands. +

      A base ICommand implementation that executes other ICommands.

      -

      - A MacroCommand maintains an list of +

      A MacroCommand maintains an list of ICommand Class references called SubCommands.

      -

      - When execute is called, the MacroCommand +

      When execute is called, the MacroCommand instantiates and calls execute on each of its SubCommands turn. Each SubCommand will be passed a reference to the original INotification that was passed to the MacroCommand's execute method.

      -

      - Unlike SimpleCommand, your subclass +

      Unlike SimpleCommand, your subclass should not override execute, but instead, should override the initializeMacroCommand method, calling addSubCommand once for each SubCommand - to be executed.

      - -

      + to be executed.

      See Also:
      Controller, @@ -301,15 +296,13 @@

      Constructor Detail

    • MacroCommand

      public MacroCommand()
      -
      Constructor. +

      Constructor.

      -

      - You should not need to define a constructor, +

      You should not need to define a constructor, instead, override the initializeMacroCommand method.

      -

      - If your subclass does define a constructor, be +

      If your subclass does define a constructor, be sure to call super().

    @@ -330,10 +323,9 @@

    Method Detail

  • addSubCommand

    protected void addSubCommand​(java.util.function.Supplier<ICommand> commandSupplier)
    -
    Add a SubCommand. +

    Add a SubCommand.

    -

    - The SubCommands will be called in First In/First Out (FIFO) +

    The SubCommands will be called in First In/First Out (FIFO) order.

    Parameters:
    @@ -348,11 +340,10 @@

    addSubCommand

  • execute

    public void execute​(INotification notification)
    -
    Execute this MacroCommand's SubCommands. +

    Execute this MacroCommand's SubCommands.

    -

    - The SubCommands will be called in First In/First Out (FIFO) - order.

    +

    The SubCommands will be called in First In/First Out (FIFO) + order.

    Specified by:
    execute in interface ICommand
    @@ -368,10 +359,9 @@

    execute

  • initializeMacroCommand

    protected void initializeMacroCommand()
    -
    Initialize the MacroCommand. +

    Initialize the MacroCommand.

    -

    - In your subclass, override this method to +

    In your subclass, override this method to initialize the MacroCommand's SubCommand list with ICommand class references like this:

    @@ -387,8 +377,8 @@

    initializeMacroCommand

    } -

    - Note that SubCommands may be any ICommand implementor, + +

    Note that SubCommands may be any ICommand implementor, MacroCommands or SimpleCommands are both acceptable.

  • diff --git a/docs/org/puremvc/java/patterns/command/SimpleCommand.html b/docs/org/puremvc/java/patterns/command/SimpleCommand.html index a9a36b4..5812651 100644 --- a/docs/org/puremvc/java/patterns/command/SimpleCommand.html +++ b/docs/org/puremvc/java/patterns/command/SimpleCommand.html @@ -2,10 +2,10 @@ - + SimpleCommand - + @@ -148,11 +148,10 @@

    Class SimpleCommand

    public class SimpleCommand
     extends Notifier
     implements ICommand
    -
    A base ICommand implementation. +

    A base ICommand implementation.

    -

    - Your subclass should override the execute - method where your business logic will handle the INotification.

    +

    Your subclass should override the execute + method where your business logic will handle the INotification.

    See Also:
    Controller, @@ -288,10 +287,9 @@

    Method Detail

  • execute

    public void execute​(INotification notification)
    -
    Fulfill the use-case initiated by the given INotification. +

    Fulfill the use-case initiated by the given INotification.

    -

    - In the Command Pattern, an application use-case typically +

    In the Command Pattern, an application use-case typically begins with some user action, which results in an INotification being broadcast, which is handled by business logic in the execute method of an ICommand.

    diff --git a/docs/org/puremvc/java/patterns/command/package-frame.html b/docs/org/puremvc/java/patterns/command/package-frame.html index 7483cdd..f526ed6 100644 --- a/docs/org/puremvc/java/patterns/command/package-frame.html +++ b/docs/org/puremvc/java/patterns/command/package-frame.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.command - + diff --git a/docs/org/puremvc/java/patterns/command/package-summary.html b/docs/org/puremvc/java/patterns/command/package-summary.html index 3b39897..7a9745c 100644 --- a/docs/org/puremvc/java/patterns/command/package-summary.html +++ b/docs/org/puremvc/java/patterns/command/package-summary.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.command - + diff --git a/docs/org/puremvc/java/patterns/command/package-tree.html b/docs/org/puremvc/java/patterns/command/package-tree.html index 363a330..a303e02 100644 --- a/docs/org/puremvc/java/patterns/command/package-tree.html +++ b/docs/org/puremvc/java/patterns/command/package-tree.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.command Class Hierarchy - + diff --git a/docs/org/puremvc/java/patterns/facade/Facade.html b/docs/org/puremvc/java/patterns/facade/Facade.html index 46f0540..ca16cac 100644 --- a/docs/org/puremvc/java/patterns/facade/Facade.html +++ b/docs/org/puremvc/java/patterns/facade/Facade.html @@ -2,10 +2,10 @@ - + Facade - + @@ -143,11 +143,11 @@

    Class Facade

    public class Facade
     extends java.lang.Object
     implements IFacade
    -
    A base Singleton IFacade implementation. +

    A base Singleton IFacade implementation.

    + +

    In PureMVC, the Facade class assumes these + responsibilities:

    -

    - In PureMVC, the Facade class assumes these - responsibilities:

    • Initializing the Model, View and Controller Singletons.
    • @@ -158,8 +158,8 @@

      Class Facade

    • Providing a single point of contact to the application for registering Commands and notifying Observers
    -

    - Example usage: + +

    Example usage:

       
     	import org.puremvc.as3.patterns.facade.Facade;
    @@ -583,13 +583,12 @@ 

    Constructor Detail

  • Facade

    public Facade()
    -
    Constructor. +

    Constructor.

    -

    - This IFacade implementation is a Singleton, +

    This IFacade implementation is a Singleton, so you should not call the constructor directly, but instead call the static Singleton - Factory method Facade.getInstance()

    + Factory method Facade.getInstance()

    Throws:
    java.lang.Error - Error if Singleton instance has already been constructed
    @@ -613,7 +612,7 @@

    Method Detail

  • getInstance

    public static IFacade getInstance​(java.util.function.Supplier<IFacade> facadeSupplier)
    -
    Facade Singleton Factory method
    +

    Facade Singleton Factory method

    Parameters:
    facadeSupplier - facade Supplier Function
    @@ -629,7 +628,7 @@

    getInstance

  • hasCommand

    public boolean hasCommand​(java.lang.String notificationName)
    -
    Check if a Command is registered for a given Notification
    +

    Check if a Command is registered for a given Notification

    Specified by:
    hasCommand in interface IFacade
    @@ -647,7 +646,7 @@

    hasCommand

  • hasMediator

    public boolean hasMediator​(java.lang.String mediatorName)
    -
    Check if a Mediator is registered or not
    +

    Check if a Mediator is registered or not

    Specified by:
    hasMediator in interface IFacade
    @@ -665,7 +664,7 @@

    hasMediator

  • hasProxy

    public boolean hasProxy​(java.lang.String proxyName)
    -
    Check if a Proxy is registered
    +

    Check if a Proxy is registered

    Specified by:
    hasProxy in interface IFacade
    @@ -683,20 +682,20 @@

    hasProxy

  • initializeController

    protected void initializeController()
    -
    Initialize the Controller. +

    Initialize the Controller.

    -

    - Called by the initializeFacade method. +

    Called by the initializeFacade method. Override this method in your subclass of Facade if one or both of the following are true:

    +
    • You wish to initialize a different IController.
    • You have Commands to register with the Controller at startup.
    +

    If you don't want to initialize a different IController, call super.initializeController() at the beginning of your - method, then register Commands. -

    + method, then register Commands.

  • @@ -706,10 +705,9 @@

    initializeController

  • initializeFacade

    protected void initializeFacade()
    -
    Initialize the Singleton Facade instance. +

    Initialize the Singleton Facade instance.

    -

    - Called automatically by the constructor. Override in your +

    Called automatically by the constructor. Override in your subclass to do any subclass specific initializations. Be sure to call super.initializeFacade(), though.

  • @@ -721,27 +719,27 @@

    initializeFacade

  • initializeModel

    protected void initializeModel()
    -
    Initialize the Model. +

    Initialize the Model.

    -

    - Called by the initializeFacade method. +

    Called by the initializeFacade method. Override this method in your subclass of Facade - if one or both of the following are true: + if one or both of the following are true:

    +
    • You wish to initialize a different IModel.
    • You have Proxys to register with the Model that do not retrieve a reference to the Facade at construction time.
    - If you don't want to initialize a different IModel, + +

    If you don't want to initialize a different IModel, call super.initializeModel() at the beginning of your - method, then register Proxys. -

    - Note: This method is rarely overridden; in practice you are more + method, then register Proxys.

    + +

    Note: This method is rarely overridden; in practice you are more likely to use a Command to create and register Proxys with the Model, since Proxys with mutable data will likely need to send INotifications and thus will likely want to fetch a reference to - the Facade during their construction. -

    + the Facade during their construction.

  • @@ -751,26 +749,26 @@

    initializeModel

  • initializeView

    protected void initializeView()
    -
    Initialize the View. +

    Initialize the View.

    -

    - Called by the initializeFacade method. +

    Called by the initializeFacade method. Override this method in your subclass of Facade - if one or both of the following are true: + if one or both of the following are true:

    +
    • You wish to initialize a different IView.
    • You have Observers to register with the View
    -

    If you don't want to initialize a different IView, + +

    If you don't want to initialize a different IView, call super.initializeView() at the beginning of your - method, then register IMediator instances.

    -

    - Note: This method is rarely overridden; in practice you are more + method, then register IMediator instances.

    + +

    Note: This method is rarely overridden; in practice you are more likely to use a Command to create and register Mediators with the View, since IMediator instances will need to send INotifications and thus will likely want to fetch a reference - to the Facade during their construction. -

    + to the Facade during their construction.

  • @@ -780,13 +778,13 @@

    initializeView

  • notifyObservers

    public void notifyObservers​(INotification notification)
    -
    Notify Observers. -

    - This method is left public mostly for backward +

    Notify Observers.

    + +

    This method is left public mostly for backward compatibility, and to allow you to send custom notification classes using the facade.

    -

    - Usually you should just call sendNotification + +

    Usually you should just call sendNotification and pass the parameters, never having to construct the notification yourself.

    @@ -805,7 +803,7 @@

    notifyObservers

    registerCommand

    public void registerCommand​(java.lang.String notificationName,
                                 java.util.function.Supplier<ICommand> commandSupplier)
    -
    Register an ICommand with the Controller by Notification name.
    +

    Register an ICommand with the Controller by Notification name.

    Specified by:
    registerCommand in interface IFacade
    @@ -822,7 +820,7 @@

    registerCommand

  • registerMediator

    public void registerMediator​(IMediator mediator)
    -
    Register a IMediator with the View.
    +

    Register a IMediator with the View.

    Specified by:
    registerMediator in interface IFacade
    @@ -838,7 +836,7 @@

    registerMediator

  • registerProxy

    public void registerProxy​(IProxy proxy)
    -
    Register an IProxy with the Model by name.
    +

    Register an IProxy with the Model by name.

    Specified by:
    registerProxy in interface IFacade
    @@ -854,7 +852,7 @@

    registerProxy

  • removeCommand

    public void removeCommand​(java.lang.String notificationName)
    -
    Remove a previously registered ICommand to INotification mapping from the Controller.
    +

    Remove a previously registered ICommand to INotification mapping from the Controller.

    Specified by:
    removeCommand in interface IFacade
    @@ -870,7 +868,7 @@

    removeCommand

  • removeMediator

    public IMediator removeMediator​(java.lang.String mediatorName)
    -
    Remove an IMediator from the View.
    +

    Remove an IMediator from the View.

    Specified by:
    removeMediator in interface IFacade
    @@ -888,7 +886,7 @@

    removeMediator

  • removeProxy

    public IProxy removeProxy​(java.lang.String proxyName)
    -
    Remove an IProxy from the Model by name.
    +

    Remove an IProxy from the Model by name.

    Specified by:
    removeProxy in interface IFacade
    @@ -906,7 +904,7 @@

    removeProxy

  • retrieveMediator

    public IMediator retrieveMediator​(java.lang.String mediatorName)
    -
    Retrieve an IMediator from the View.
    +

    Retrieve an IMediator from the View.

    Specified by:
    retrieveMediator in interface IFacade
    @@ -924,7 +922,7 @@

    retrieveMediator

  • retrieveProxy

    public IProxy retrieveProxy​(java.lang.String proxyName)
    -
    Retrieve an IProxy from the Model by name.
    +

    Retrieve an IProxy from the Model by name.

    Specified by:
    retrieveProxy in interface IFacade
    @@ -942,11 +940,10 @@

    retrieveProxy

  • sendNotification

    public void sendNotification​(java.lang.String notificationName)
    -
    Create and send an INotification. +

    Create and send an INotification.

    -

    - Keeps us from having to construct new notification - instances in our implementation code.

    +

    Keeps us from having to construct new notification + instances in our implementation code.

    Specified by:
    sendNotification in interface INotifier
    @@ -963,11 +960,10 @@

    sendNotification

    sendNotification

    public void sendNotification​(java.lang.String notificationName,
                                  java.lang.Object body)
    -
    Create and send an INotification. +

    Create and send an INotification.

    -

    - Keeps us from having to construct new notification - instances in our implementation code.

    +

    Keeps us from having to construct new notification + instances in our implementation code.

    Specified by:
    sendNotification in interface INotifier
    @@ -986,11 +982,10 @@

    sendNotification

    public void sendNotification​(java.lang.String notificationName,
                                  java.lang.Object body,
                                  java.lang.String type)
    -
    Create and send an INotification. +

    Create and send an INotification.

    -

    - Keeps us from having to construct new notification - instances in our implementation code.

    +

    Keeps us from having to construct new notification + instances in our implementation code.

    Specified by:
    sendNotification in interface INotifier
    diff --git a/docs/org/puremvc/java/patterns/facade/package-frame.html b/docs/org/puremvc/java/patterns/facade/package-frame.html index a55f724..4eca579 100644 --- a/docs/org/puremvc/java/patterns/facade/package-frame.html +++ b/docs/org/puremvc/java/patterns/facade/package-frame.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.facade - + diff --git a/docs/org/puremvc/java/patterns/facade/package-summary.html b/docs/org/puremvc/java/patterns/facade/package-summary.html index c014690..c2839e0 100644 --- a/docs/org/puremvc/java/patterns/facade/package-summary.html +++ b/docs/org/puremvc/java/patterns/facade/package-summary.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.facade - + diff --git a/docs/org/puremvc/java/patterns/facade/package-tree.html b/docs/org/puremvc/java/patterns/facade/package-tree.html index a3ae8df..5723351 100644 --- a/docs/org/puremvc/java/patterns/facade/package-tree.html +++ b/docs/org/puremvc/java/patterns/facade/package-tree.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.facade Class Hierarchy - + diff --git a/docs/org/puremvc/java/patterns/mediator/Mediator.html b/docs/org/puremvc/java/patterns/mediator/Mediator.html index d64048c..6540a6f 100644 --- a/docs/org/puremvc/java/patterns/mediator/Mediator.html +++ b/docs/org/puremvc/java/patterns/mediator/Mediator.html @@ -2,10 +2,10 @@ - + Mediator - + @@ -148,7 +148,7 @@

    Class Mediator

    public class Mediator
     extends Notifier
     implements IMediator
    -
    A base IMediator implementation.
    +

    A base IMediator implementation.

    See Also:
    View
    @@ -355,10 +355,9 @@

    mediatorName

  • NAME

    public static final java.lang.String NAME
    -
    The name of the Mediator. +

    The name of the Mediator.

    -

    - Typically, a Mediator will be written to serve +

    Typically, a Mediator will be written to serve one specific control or group controls and so, will not have a need to be dynamically named.

    @@ -393,7 +392,7 @@

    Constructor Detail

  • Mediator

    public Mediator()
    -
    Constructor.
    +

    Constructor.

  • @@ -403,7 +402,7 @@

    Mediator

  • Mediator

    public Mediator​(java.lang.String mediatorName)
    -
    Constructor.
    +

    Constructor.

    Parameters:
    mediatorName - mediator name
    @@ -418,7 +417,7 @@

    Mediator

    Mediator

    public Mediator​(java.lang.String mediatorName,
                     java.lang.Object viewComponent)
    -
    Constructor.
    +

    Constructor.

    Parameters:
    mediatorName - mediator name
    @@ -443,7 +442,7 @@

    Method Detail

  • getMediatorName

    public java.lang.String getMediatorName()
    -
    Get the name of the Mediator.
    +

    Get the name of the Mediator.

    Specified by:
    getMediatorName in interface IMediator
    @@ -459,10 +458,9 @@

    getMediatorName

  • getViewComponent

    public java.lang.Object getViewComponent()
    -
    Get the Mediator's view component. +

    Get the Mediator's view component.

    -

    - Additionally, an implicit getter will usually +

    Additionally, an implicit getter will usually be defined in the subclass that casts the view object to a type, like this:

    @@ -487,12 +485,11 @@

    getViewComponent

  • handleNotification

    public void handleNotification​(INotification notification)
    -
    Handle INotifications. +

    Handle INotifications.

    -

    - Typically this will be handled in a switch statement, +

    Typically this will be handled in a switch statement, with one 'case' entry per INotification - the Mediator is interested in.

    + the Mediator is interested in.

    Specified by:
    handleNotification in interface IMediator
    @@ -508,8 +505,8 @@

    handleNotification

  • listNotificationInterests

    public java.lang.String[] listNotificationInterests()
    -
    List the INotification names this - Mediator is interested in being notified of.
    +

    List the INotification names this + Mediator is interested in being notified of.

    Specified by:
    listNotificationInterests in interface IMediator
    @@ -525,7 +522,7 @@

    listNotificationInterests

  • onRegister

    public void onRegister()
    -
    Called by the View when the Mediator is registered
    +

    Called by the View when the Mediator is registered

    Specified by:
    onRegister in interface IMediator
    @@ -539,7 +536,7 @@

    onRegister

  • onRemove

    public void onRemove()
    -
    Called by the View when the Mediator is removed
    +

    Called by the View when the Mediator is removed

    Specified by:
    onRemove in interface IMediator
    @@ -553,7 +550,7 @@

    onRemove

  • setViewComponent

    public void setViewComponent​(java.lang.Object viewComponent)
    -
    Set the IMediator's view component.
    +

    Set the IMediator's view component.

    Specified by:
    setViewComponent in interface IMediator
    diff --git a/docs/org/puremvc/java/patterns/mediator/package-frame.html b/docs/org/puremvc/java/patterns/mediator/package-frame.html index d08e69b..a88935f 100644 --- a/docs/org/puremvc/java/patterns/mediator/package-frame.html +++ b/docs/org/puremvc/java/patterns/mediator/package-frame.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.mediator - + diff --git a/docs/org/puremvc/java/patterns/mediator/package-summary.html b/docs/org/puremvc/java/patterns/mediator/package-summary.html index 512f986..1dacaa9 100644 --- a/docs/org/puremvc/java/patterns/mediator/package-summary.html +++ b/docs/org/puremvc/java/patterns/mediator/package-summary.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.mediator - + diff --git a/docs/org/puremvc/java/patterns/mediator/package-tree.html b/docs/org/puremvc/java/patterns/mediator/package-tree.html index eef4bda..6f2e8bc 100644 --- a/docs/org/puremvc/java/patterns/mediator/package-tree.html +++ b/docs/org/puremvc/java/patterns/mediator/package-tree.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.mediator Class Hierarchy - + diff --git a/docs/org/puremvc/java/patterns/observer/Notification.html b/docs/org/puremvc/java/patterns/observer/Notification.html index 5cd2160..ef76bb5 100644 --- a/docs/org/puremvc/java/patterns/observer/Notification.html +++ b/docs/org/puremvc/java/patterns/observer/Notification.html @@ -2,10 +2,10 @@ - + Notification - + @@ -143,20 +143,17 @@

    Class Notification

    public class Notification
     extends java.lang.Object
     implements INotification
    -
    A base INotification implementation. +

    A base INotification implementation.

    -

    - PureMVC does not rely upon underlying event models such +

    PureMVC does not rely upon underlying event models such as the one provided with Flash, and ActionScript 3 does not have an inherent event model.

    -

    - The Observer Pattern as implemented within PureMVC exists +

    The Observer Pattern as implemented within PureMVC exists to support event-driven communication between the application and the actors of the MVC triad.

    -

    - Notifications are not meant to be a replacement for Events +

    Notifications are not meant to be a replacement for Events in Flex/Flash/Apollo. Generally, IMediator implementors place event listeners on their view components, which they then handle in the usual way. This may lead to the broadcast of Notifications to @@ -164,15 +161,14 @@

    Class Notification

    instances communicate with each other and IMediators by broadcasting INotifications.

    -

    - A key difference between Flash Events and PureMVC +

    A key difference between Flash Events and PureMVC Notifications is that Events follow the 'Chain of Responsibility' pattern, 'bubbling' up the display hierarchy until some parent component handles the Event, while PureMVC Notifications follow a 'Publish/Subscribe' pattern. PureMVC classes need not be related to each other in a parent/child relationship in order to communicate with one another - using Notifications.

    + using Notifications.

    See Also:
    Observer
    @@ -308,7 +304,7 @@

    Constructor Detail

  • Notification

    public Notification​(java.lang.String name)
    -
    Constructor.
    +

    Constructor.

    Parameters:
    name - name of the Notification instance.
    @@ -323,7 +319,7 @@

    Notification

    Notification

    public Notification​(java.lang.String name,
                         java.lang.Object body)
    -
    Constructor.
    +

    Constructor.

    Parameters:
    name - name of the Notification instance.
    @@ -340,7 +336,7 @@

    Notification

    public Notification​(java.lang.String name,
                         java.lang.Object body,
                         java.lang.String type)
    -
    Constructor.
    +

    Constructor.

    Parameters:
    name - name of the Notification instance. (required)
    @@ -366,7 +362,7 @@

    Method Detail

  • getBody

    public java.lang.Object getBody()
    -
    Get the body of the Notification instance.
    +

    Get the body of the Notification instance.

    Specified by:
    getBody in interface INotification
    @@ -382,7 +378,7 @@

    getBody

  • getName

    public java.lang.String getName()
    -
    Get the name of the Notification instance.
    +

    Get the name of the Notification instance.

    Specified by:
    getName in interface INotification
    @@ -398,7 +394,7 @@

    getName

  • getType

    public java.lang.String getType()
    -
    Get the type of the Notification instance.
    +

    Get the type of the Notification instance.

    Specified by:
    getType in interface INotification
    @@ -414,7 +410,7 @@

    getType

  • setBody

    public void setBody​(java.lang.Object body)
    -
    Set the body of the Notification instance.
    +

    Set the body of the Notification instance.

    Specified by:
    setBody in interface INotification
    @@ -430,7 +426,7 @@

    setBody

  • setType

    public void setType​(java.lang.String type)
    -
    Set the type of the Notification instance.
    +

    Set the type of the Notification instance.

    Specified by:
    setType in interface INotification
    @@ -446,7 +442,7 @@

    setType

  • toString

    public java.lang.String toString()
    -
    Get the string representation of the Notification instance.
    +

    Get the string representation of the Notification instance.

    Specified by:
    toString in interface INotification
    diff --git a/docs/org/puremvc/java/patterns/observer/Notifier.html b/docs/org/puremvc/java/patterns/observer/Notifier.html index 270e6f3..a899ac8 100644 --- a/docs/org/puremvc/java/patterns/observer/Notifier.html +++ b/docs/org/puremvc/java/patterns/observer/Notifier.html @@ -2,10 +2,10 @@ - + Notifier - + @@ -147,26 +147,21 @@

    Class Notifier

    public class Notifier
     extends java.lang.Object
     implements INotifier
    -
    A Base INotifier implementation. +

    A Base INotifier implementation.

    -

    - MacroCommand, Command, Mediator and Proxy all - have a need to send Notifications. -

    -

    - The INotifier interface provides a common method called +

    MacroCommand, Command, Mediator and Proxy all + have a need to send Notifications.

    + +

    The INotifier interface provides a common method called sendNotification that relieves implementation code of the - necessity to actually construct Notifications. -

    + necessity to actually construct Notifications.

    -

    - The Notifier class, which all of the above mentioned classes +

    The Notifier class, which all of the above mentioned classes extend, provides an initialized reference to the Facade Singleton, which is required for the convienience method for sending Notifications, but also eases implementation as these classes have frequent Facade interactions and usually require access - to the facade anyway. -

    + to the facade anyway.

    See Also:
    Facade, @@ -296,7 +291,7 @@

    Field Detail

  • facade

    protected IFacade facade
    -
    Local reference to the Facade Singleton
    +

    Local reference to the Facade Singleton

  • @@ -335,11 +330,10 @@

    Method Detail

  • sendNotification

    public void sendNotification​(java.lang.String notificationName)
    -
    Send an INotifications. +

    Send an INotifications.

    -

    - Keeps us from having to construct new notification instances in our - implementation code.

    +

    Keeps us from having to construct new notification instances in our + implementation code.

    Specified by:
    sendNotification in interface INotifier
    @@ -356,11 +350,10 @@

    sendNotification

    sendNotification

    public void sendNotification​(java.lang.String notificationName,
                                  java.lang.Object body)
    -
    Send an INotifications. +

    Send an INotifications.

    -

    - Keeps us from having to construct new notification instances in our - implementation code.

    +

    Keeps us from having to construct new notification instances in our + implementation code.

    Specified by:
    sendNotification in interface INotifier
    @@ -379,11 +372,10 @@

    sendNotification

    public void sendNotification​(java.lang.String notificationName,
                                  java.lang.Object body,
                                  java.lang.String type)
    -
    Send an INotifications. +

    Send an INotifications.

    -

    - Keeps us from having to construct new notification instances in our - implementation code.

    +

    Keeps us from having to construct new notification instances in our + implementation code.

    Specified by:
    sendNotification in interface INotifier
    diff --git a/docs/org/puremvc/java/patterns/observer/Observer.html b/docs/org/puremvc/java/patterns/observer/Observer.html index d463f27..303995d 100644 --- a/docs/org/puremvc/java/patterns/observer/Observer.html +++ b/docs/org/puremvc/java/patterns/observer/Observer.html @@ -2,10 +2,10 @@ - + Observer - + @@ -143,15 +143,14 @@

    Class Observer

    public class Observer
     extends java.lang.Object
     implements IObserver
    -
    A base IObserver implementation. +

    A base IObserver implementation.

    -

    - An Observer is an object that encapsulates information +

    An Observer is an object that encapsulates information about an interested object with a method that should - be called when a particular INotification is broadcast.

    + be called when a particular INotification is broadcast.

    + +

    In PureMVC, the Observer class assumes these responsibilities:

    -

    - In PureMVC, the Observer class assumes these responsibilities:

    • Encapsulate the notification (callback) method of the interested object.
    • Encapsulate the notification context (this) of the interested object.
    • @@ -281,12 +280,10 @@

      Constructor Detail

      Observer

      public Observer​(java.util.function.Consumer<INotification> notifyMethod,
                       java.lang.Object notifyContext)
      -
      Constructor. +

      Constructor.

      -

      - The notification method on the interested object should take one - parameter of type INotification -

      +

      The notification method on the interested object should take one + parameter of type INotification

      Parameters:
      notifyMethod - the notification method of the interested object
      @@ -311,7 +308,7 @@

      Method Detail

    • compareNotifyContext

      public boolean compareNotifyContext​(java.lang.Object object)
      -
      Compare an object to the notification context.
      +

      Compare an object to the notification context.

      Specified by:
      compareNotifyContext in interface IObserver
      @@ -330,7 +327,7 @@

      compareNotifyContext

    • getNotifyContext

      protected java.lang.Object getNotifyContext()
      -
      Get the notification context.
      +

      Get the notification context.

      Returns:
      the notification context (this) of the @@ -345,7 +342,7 @@

      getNotifyContext

    • getNotifyMethod

      protected java.util.function.Consumer<INotification> getNotifyMethod()
      -
      Get the notification method.
      +

      Get the notification method.

      Returns:
      the notification (callback) consumer function of the interested object.
      @@ -359,7 +356,7 @@

      getNotifyMethod

    • notifyObserver

      public void notifyObserver​(INotification notification)
      -
      Notify the interested object.
      +

      Notify the interested object.

      Specified by:
      notifyObserver in interface IObserver
      @@ -376,7 +373,7 @@

      notifyObserver

    • setNotifyContext

      public void setNotifyContext​(java.lang.Object notifyContext)
      -
      Set the notification context.
      +

      Set the notification context.

      Specified by:
      setNotifyContext in interface IObserver
      @@ -392,12 +389,10 @@

      setNotifyContext

    • setNotifyMethod

      public void setNotifyMethod​(java.util.function.Consumer<INotification> notifyMethod)
      -
      Set the notification method. +

      Set the notification method.

      -

      - The notification method should take one parameter of type - INotification. -

      +

      The notification method should take one parameter of type + INotification.

      Specified by:
      setNotifyMethod in interface IObserver
      diff --git a/docs/org/puremvc/java/patterns/observer/package-frame.html b/docs/org/puremvc/java/patterns/observer/package-frame.html index bdfe468..df9c04c 100644 --- a/docs/org/puremvc/java/patterns/observer/package-frame.html +++ b/docs/org/puremvc/java/patterns/observer/package-frame.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.observer - + diff --git a/docs/org/puremvc/java/patterns/observer/package-summary.html b/docs/org/puremvc/java/patterns/observer/package-summary.html index 70f440a..6c4a671 100644 --- a/docs/org/puremvc/java/patterns/observer/package-summary.html +++ b/docs/org/puremvc/java/patterns/observer/package-summary.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.observer - + diff --git a/docs/org/puremvc/java/patterns/observer/package-tree.html b/docs/org/puremvc/java/patterns/observer/package-tree.html index 17833bd..e06059a 100644 --- a/docs/org/puremvc/java/patterns/observer/package-tree.html +++ b/docs/org/puremvc/java/patterns/observer/package-tree.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.observer Class Hierarchy - + diff --git a/docs/org/puremvc/java/patterns/proxy/Proxy.html b/docs/org/puremvc/java/patterns/proxy/Proxy.html index 087b5c2..c1bda08 100644 --- a/docs/org/puremvc/java/patterns/proxy/Proxy.html +++ b/docs/org/puremvc/java/patterns/proxy/Proxy.html @@ -2,10 +2,10 @@ - + Proxy - + @@ -148,26 +148,20 @@

      Class Proxy

      public class Proxy
       extends Notifier
       implements IProxy
      -
      A base IProxy implementation. +

      A base IProxy implementation.

      -

      - In PureMVC, Proxy classes are used to manage parts of the - application's data model. -

      +

      In PureMVC, Proxy classes are used to manage parts of the + application's data model.

      -

      - A Proxy might simply manage a reference to a local data +

      A Proxy might simply manage a reference to a local data object, in which case interacting with it might involve setting and getting - of its data in synchronous fashion. -

      + of its data in synchronous fashion.

      -

      - Proxy classes are also used to encapsulate the application's +

      Proxy classes are also used to encapsulate the application's interaction with remote services to save or retrieve data, in which case, we adopt an asyncronous idiom; setting data (or calling a method) on the Proxy and listening for a Notification to be - sent when the Proxy has retrieved the data from the service. -

      + sent when the Proxy has retrieved the data from the service.

      See Also:
      Model
      @@ -233,7 +227,9 @@

      Constructor Summary

      Proxy() -  + +
      Constructor
      + Proxy​(java.lang.String proxyName) @@ -387,6 +383,7 @@

      Constructor Detail

    • Proxy

      public Proxy()
      +

      Constructor

    @@ -396,7 +393,7 @@

    Proxy

  • Proxy

    public Proxy​(java.lang.String proxyName)
    -
    Constructor
    +

    Constructor

    Parameters:
    proxyName - Name of the Proxy
    @@ -411,7 +408,7 @@

    Proxy

    Proxy

    public Proxy​(java.lang.String proxyName,
                  java.lang.Object data)
    -
    Constructor
    +

    Constructor

    Parameters:
    proxyName - proxy name
    @@ -436,7 +433,7 @@

    Method Detail

  • getData

    public java.lang.Object getData()
    -
    Get the data object
    +

    Get the data object

    Specified by:
    getData in interface IProxy
    @@ -452,7 +449,7 @@

    getData

  • getProxyName

    public java.lang.String getProxyName()
    -
    Get the proxy name
    +

    Get the proxy name

    Specified by:
    getProxyName in interface IProxy
    @@ -468,7 +465,7 @@

    getProxyName

  • onRegister

    public void onRegister()
    -
    Called by the Model when the Proxy is registered
    +

    Called by the Model when the Proxy is registered

    Specified by:
    onRegister in interface IProxy
    @@ -482,7 +479,7 @@

    onRegister

  • onRemove

    public void onRemove()
    -
    Called by the Model when the Proxy is removed
    +

    Called by the Model when the Proxy is removed

    Specified by:
    onRemove in interface IProxy
    @@ -496,7 +493,7 @@

    onRemove

  • setData

    public void setData​(java.lang.Object data)
    -
    Set the data object
    +

    Set the data object

    Specified by:
    setData in interface IProxy
    diff --git a/docs/org/puremvc/java/patterns/proxy/package-frame.html b/docs/org/puremvc/java/patterns/proxy/package-frame.html index 6a4665b..d5c139c 100644 --- a/docs/org/puremvc/java/patterns/proxy/package-frame.html +++ b/docs/org/puremvc/java/patterns/proxy/package-frame.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.proxy - + diff --git a/docs/org/puremvc/java/patterns/proxy/package-summary.html b/docs/org/puremvc/java/patterns/proxy/package-summary.html index c93382e..9474ac3 100644 --- a/docs/org/puremvc/java/patterns/proxy/package-summary.html +++ b/docs/org/puremvc/java/patterns/proxy/package-summary.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.proxy - + diff --git a/docs/org/puremvc/java/patterns/proxy/package-tree.html b/docs/org/puremvc/java/patterns/proxy/package-tree.html index 7a686cc..ca61141 100644 --- a/docs/org/puremvc/java/patterns/proxy/package-tree.html +++ b/docs/org/puremvc/java/patterns/proxy/package-tree.html @@ -2,10 +2,10 @@ - + org.puremvc.java.patterns.proxy Class Hierarchy - + diff --git a/docs/overview-frame.html b/docs/overview-frame.html index 33dfe69..14ea7a1 100644 --- a/docs/overview-frame.html +++ b/docs/overview-frame.html @@ -2,10 +2,10 @@ - + Overview List - + diff --git a/docs/overview-summary.html b/docs/overview-summary.html index fe7d16f..0e9b275 100644 --- a/docs/overview-summary.html +++ b/docs/overview-summary.html @@ -2,10 +2,10 @@ - + Overview - + diff --git a/docs/overview-tree.html b/docs/overview-tree.html index cf3a2fa..91f23bd 100644 --- a/docs/overview-tree.html +++ b/docs/overview-tree.html @@ -2,10 +2,10 @@ - + Class Hierarchy - + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..9f01e59 --- /dev/null +++ b/pom.xml @@ -0,0 +1,161 @@ + + + 4.0.0 + + org.puremvc + puremvc + 2.1 + jar + PureMVC + + PureMVC is a lightweight framework for creating applications + based upon the classic Model-View-Controller design + meta-pattern. This is the specific implementation for the Java + language. It does not support modular programming since it + uses Singletons as Core actors rather than the Multiton used in + the MultiCore Version. + + http://puremvc.org + + + + org.junit.jupiter + junit-jupiter-engine + 5.4.1 + test + + + + + + + Reuse governed by Creative Commons Attribution 3.0 + United States License + + http://creativecommons.org/licenses/by/3.0/us/ + repo + + + + + + saadshams + Saad Shams + saad.shams@puremvc.org + PureMVC + http://puremvc.org + + + + + scm:git:git://github.com/PureMVC/puremvc-java-standard-framework.git + scm:git:ssh://github.com:PureMVC/puremvc-java-standard-framework.git + http://github.com/PureMVC/puremvc-java-standard-framework/tree/master + + + + Github + https://github.com/PureMVC/puremvc-java-standard-framework/issues + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.3 + + 1.8 + 1.8 + + + + org.apache.maven.plugins + maven-jar-plugin + 2.3.1 + + bin + PureMVC + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://oss.sonatype.org/ + true + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + -html5 + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://oss.sonatype.org/ + false + + + + + + \ No newline at end of file diff --git a/src/org/puremvc/java/core/Controller.java b/src/main/java/org/puremvc/java/core/Controller.java similarity index 79% rename from src/org/puremvc/java/core/Controller.java rename to src/main/java/org/puremvc/java/core/Controller.java index 574d20e..879aaa4 100644 --- a/src/org/puremvc/java/core/Controller.java +++ b/src/main/java/org/puremvc/java/core/Controller.java @@ -20,10 +20,11 @@ /** * A Singleton IController implementation. * - *

    - * In PureMVC, the Controller class follows the + * + *

    In PureMVC, the Controller class follows the * 'Command and Controller' strategy, and assumes these - * responsibilities: + * responsibilities:

    + * *
      *
    • Remembering which ICommands * are intended to handle which INotifications.
    • @@ -36,15 +37,15 @@ * method, passing in the INotification. *
    * - *

    - * Your application must register ICommands with the - * Controller. - *

    - * The simplest way is to subclass Facade, + * + *

    Your application must register ICommands with the + * Controller.

    + * + *

    The simplest way is to subclass Facade, * and use its initializeController method to add your - * registrations. + * registrations.

    * - * @see org.puremvc.java.core.View View + * @see View View * @see org.puremvc.java.patterns.observer.Observer Observer * @see org.puremvc.java.patterns.observer.Notification Notification * @see org.puremvc.java.patterns.command.SimpleCommand SimpleCommand @@ -67,11 +68,10 @@ public class Controller implements IController { /** * Constructor. * - *

    - * This IController implementation is a Singleton, + *

    This IController implementation is a Singleton, * so you should not call the constructor * directly, but instead call the static Singleton - * Factory method Controller.getInstance() + * Factory method Controller.getInstance()

    * * @throws Error Error if Singleton instance has already been constructed * @@ -84,7 +84,7 @@ public Controller() { } /** - * Initialize the Singleton Controller instance. + *

    Initialize the Singleton Controller instance.

    * *

    Called automatically by the constructor.

    * @@ -93,21 +93,21 @@ public Controller() { * and override the initializeController method in the * following way:

    * - * {@code - * // ensure that the Controller is talking to my IView implementation - * override public function initializeController( ) : void - * { - * view = MyView.getInstance(() -> new MyView()); - * } + *
    +     * {@code // ensure that the Controller is talking to my IView implementation
    +     * override public function initializeController(  ) : void
    +     * {
    +     *     view = MyView.getInstance(() -> new MyView());
          * }
    -     *
    +     * }
    +     * 
    */ public void initializeController() { view = View.getInstance(() -> new View()); } /** - * Controller Singleton Factory method. + *

    Controller Singleton Factory method.

    * * @param controllerSupplier controller supplier function * @return the Singleton instance of Controller @@ -118,8 +118,8 @@ public synchronized static IController getInstance(Supplier control } /** - * If an ICommand has previously been registered - * to handle a the given INotification, then it is executed. + *

    If an ICommand has previously been registered + * to handle a the given INotification, then it is executed.

    * * @param notification an INotification */ @@ -131,16 +131,15 @@ public void executeCommand(INotification notification) { } /** - * Register a particular ICommand class as the handler - * for a particular INotification. + *

    Register a particular ICommand class as the handler + * for a particular INotification.

    * - *

    - * If an ICommand has already been registered to + *

    If an ICommand has already been registered to * handle INotifications with this name, it is no longer * used, the new ICommand is used instead.

    * - * The Observer for the new ICommand is only created if this the - * first time an ICommand has been regisered for this Notification name. + *

    The Observer for the new ICommand is only created if this the + * first time an ICommand has been regisered for this Notification name.

    * * @param notificationName the name of the INotification * @param commandSupplier the Class of the ICommand @@ -153,7 +152,7 @@ public void registerCommand(String notificationName, Supplier commandS } /** - * Remove a previously registered ICommand to INotification mapping. + *

    Remove a previously registered ICommand to INotification mapping.

    * * @param notificationName the name of the INotification to remove the ICommand mapping for */ @@ -165,7 +164,7 @@ public void removeCommand(String notificationName) { } /** - * Check if a Command is registered for a given Notification + *

    Check if a Command is registered for a given Notification

    * * @param notificationName notification name * @return whether a Command is currently registered for the given notificationName. diff --git a/src/org/puremvc/java/core/Model.java b/src/main/java/org/puremvc/java/core/Model.java similarity index 78% rename from src/org/puremvc/java/core/Model.java rename to src/main/java/org/puremvc/java/core/Model.java index c76cff8..04076a0 100644 --- a/src/org/puremvc/java/core/Model.java +++ b/src/main/java/org/puremvc/java/core/Model.java @@ -15,14 +15,12 @@ import java.util.function.Supplier; /** - * A Singleton IModel implementation. + *

    A Singleton IModel implementation.

    * - *

    - * In PureMVC, the Model class provides - * access to model objects (Proxies) by named lookup. + *

    In PureMVC, the Model class provides + * access to model objects (Proxies) by named lookup.

    * - *

    - * The Model assumes these responsibilities:

    + *

    The Model assumes these responsibilities:

    * *
      *
    • Maintain a cache of IProxy instances.
    • @@ -30,12 +28,11 @@ * IProxy instances. *
    * - *

    - * Your application must register IProxy instances + *

    Your application must register IProxy instances * with the Model. Typically, you use an * ICommand to create and register IProxy * instances once the Facade has initialized the Core - * actors.

    + * actors.

    * * @see org.puremvc.java.patterns.proxy.Proxy Proxy * @see org.puremvc.java.interfaces.IProxy IProxy @@ -52,13 +49,12 @@ public class Model implements IModel { protected final String SINGLETON_MSG = "Model Singleton already constructed!"; /** - * Constructor. + *

    Constructor.

    * - *

    - * This IModel implementation is a Singleton, + *

    This IModel implementation is a Singleton, * so you should not call the constructor * directly, but instead call the static Singleton - * Factory method Model.getInstance() + * Factory method Model.getInstance()

    * * @throws Error Error if Singleton instance has already been constructed * @@ -71,10 +67,9 @@ public Model() { } /** - * Initialize the Singleton Model instance. + *

    Initialize the Singleton Model instance.

    * - *

    - * Called automatically by the constructor, this + *

    Called automatically by the constructor, this * is your opportunity to initialize the Singleton * instance in your subclass without overriding the * constructor.

    @@ -84,7 +79,7 @@ protected void initializeModel() { } /** - * Model Singleton Factory method. + *

    Model Singleton Factory method.

    * * @param modelSupplier model supplier function * @return the Singleton instance @@ -95,7 +90,7 @@ public synchronized static IModel getInstance(Supplier modelSupplier) { } /** - * Register an IProxy with the Model. + *

    Register an IProxy with the Model.

    * * @param proxy an IProxy to be held by the Model. */ @@ -105,7 +100,7 @@ public void registerProxy(IProxy proxy) { } /** - * Retrieve an IProxy from the Model. + *

    Retrieve an IProxy from the Model.

    * * @param proxyName proxy name * @return the IProxy instance previously registered with the given proxyName. @@ -115,7 +110,7 @@ public IProxy retrieveProxy(String proxyName) { } /** - * Check if a Proxy is registered + *

    Check if a Proxy is registered

    * * @param proxyName proxy name * @return whether a Proxy is currently registered with the given proxyName. @@ -125,7 +120,7 @@ public boolean hasProxy(String proxyName) { } /** - * Remove an IProxy from the Model. + *

    Remove an IProxy from the Model.

    * * @param proxyName name of the IProxy instance to be removed. * @return the IProxy that was removed from the Model diff --git a/src/org/puremvc/java/core/View.java b/src/main/java/org/puremvc/java/core/View.java similarity index 86% rename from src/org/puremvc/java/core/View.java rename to src/main/java/org/puremvc/java/core/View.java index 7cb2163..e091e82 100644 --- a/src/org/puremvc/java/core/View.java +++ b/src/main/java/org/puremvc/java/core/View.java @@ -21,10 +21,10 @@ import java.util.function.Supplier; /** - * A Singleton IView implementation. + *

    A Singleton IView implementation.

    + * + *

    In PureMVC, the View class assumes these responsibilities:

    * - *

    - * In PureMVC, the View class assumes these responsibilities: *

      *
    • Maintain a cache of IMediator instances.
    • *
    • Provide methods for registering, retrieving, and removing IMediators.
    • @@ -54,13 +54,12 @@ public class View implements IView { protected final String SINGLETON_MSG = "View Singleton already constructed!"; /** - * Constructor. + *

      Constructor.

      * - *

      - * This IView implementation is a Singleton, + *

      This IView implementation is a Singleton, * so you should not call the constructor * directly, but instead call the static Singleton - * Factory method View.getInstance() + * Factory method View.getInstance()

      * * @throws Error Error if Singleton instance has already been constructed * @@ -74,7 +73,7 @@ public View() { } /** - * View Singleton Factory method. + *

      View Singleton Factory method.

      * * @param viewSupplier view supplier function * @return the Singleton instance of View @@ -85,21 +84,19 @@ public synchronized static IView getInstance(Supplier viewSupplier) { } /** - * Initialize the Singleton View instance. + *

      Initialize the Singleton View instance.

      * - *

      - * Called automatically by the constructor, this + *

      Called automatically by the constructor, this * is your opportunity to initialize the Singleton * instance in your subclass without overriding the * constructor.

      - * */ protected void initializeView() { } /** - * Register an IObserver to be notified - * of INotifications with a given name. + *

      Register an IObserver to be notified + * of INotifications with a given name.

      * * @param notificationName the name of the INotifications to notify this IObserver of * @param observer the IObserver to register @@ -113,10 +110,9 @@ public void registerObserver(String notificationName, IObserver observer) { } /** - * Notify the IObservers for a particular INotification. + *

      Notify the IObservers for a particular INotification.

      * - *

      - * All previously attached IObservers for this INotification's + *

      All previously attached IObservers for this INotification's * list are notified and are passed a reference to the INotification in * the order in which they were registered.

      * @@ -137,8 +133,8 @@ public void notifyObservers(INotification notification) { } /** - * Remove the observer for a given notifyContext from an observer list for a given Notification name. - *

      + *

      Remove the observer for a given notifyContext from an observer list for a given Notification name.

      + * * @param notificationName which observer list to remove from * @param notifyContext remove the observer with this object as its notifyContext */ @@ -164,18 +160,17 @@ public void removeObserver(String notificationName, Object notifyContext) { } /** - * Register an IMediator instance with the View. + *

      Register an IMediator instance with the View.

      * - *

      - * Registers the IMediator so that it can be retrieved by name, + *

      Registers the IMediator so that it can be retrieved by name, * and further interrogates the IMediator for its * INotification interests.

      - *

      - * If the IMediator returns any INotification + * + *

      If the IMediator returns any INotification * names to be notified about, an Observer is created encapsulating * the IMediator instance's handleNotification method * and registering it as an Observer for all INotifications the - * IMediator is interested in.

      + * IMediator is interested in.

      * * @param mediator a reference to the IMediator instance */ @@ -205,7 +200,7 @@ public void registerMediator(IMediator mediator) { } /** - * Retrieve an IMediator from the View. + *

      Retrieve an IMediator from the View.

      * * @param mediatorName the name of the IMediator instance to retrieve. * @return the IMediator instance previously registered with the given mediatorName. @@ -215,7 +210,7 @@ public IMediator retrieveMediator(String mediatorName) { } /** - * Remove an IMediator from the View. + *

      Remove an IMediator from the View.

      * * @param mediatorName name of the IMediator instance to be removed. * @return the IMediator that was removed from the View @@ -244,7 +239,7 @@ public IMediator removeMediator(String mediatorName) { } /** - * Check if a Mediator is registered or not + *

      Check if a Mediator is registered or not

      * * @param mediatorName mediator name * @return whether a Mediator is registered with the given mediatorName. diff --git a/src/org/puremvc/java/interfaces/ICommand.java b/src/main/java/org/puremvc/java/interfaces/ICommand.java similarity index 83% rename from src/org/puremvc/java/interfaces/ICommand.java rename to src/main/java/org/puremvc/java/interfaces/ICommand.java index d3629f0..8a8c4d5 100644 --- a/src/org/puremvc/java/interfaces/ICommand.java +++ b/src/main/java/org/puremvc/java/interfaces/ICommand.java @@ -15,7 +15,7 @@ public interface ICommand extends INotifier { /** - * Execute the ICommand's logic to handle a given INotification. + *

      Execute the ICommand's logic to handle a given INotification.

      * * @param notification an INotification to handle. */ diff --git a/src/org/puremvc/java/interfaces/IController.java b/src/main/java/org/puremvc/java/interfaces/IController.java similarity index 77% rename from src/org/puremvc/java/interfaces/IController.java rename to src/main/java/org/puremvc/java/interfaces/IController.java index d43341d..f2eee12 100644 --- a/src/org/puremvc/java/interfaces/IController.java +++ b/src/main/java/org/puremvc/java/interfaces/IController.java @@ -10,12 +10,12 @@ import java.util.function.Supplier; /** - * The interface definition for a PureMVC Controller. + *

      The interface definition for a PureMVC Controller.

      * - *

      - * In PureMVC, an IController implementor + *

      In PureMVC, an IController implementor * follows the 'Command and Controller' strategy, and - * assumes these responsibilities: + * assumes these responsibilities:

      + * *
        *
      • Remembering which ICommands * are intended to handle which INotifications.
      • @@ -34,8 +34,8 @@ public interface IController { /** - * Register a particular ICommand class as the handler - * for a particular INotification. + *

        Register a particular ICommand class as the handler + * for a particular INotification.

        * * @param notificationName the name of the INotification * @param commandSupplier the Supplier Function of the ICommand @@ -43,22 +43,22 @@ public interface IController { void registerCommand(String notificationName, Supplier commandSupplier); /** - * Execute the ICommand previously registered as the - * handler for INotifications with the given notification name. + *

        Execute the ICommand previously registered as the + * handler for INotifications with the given notification name.

        * * @param notification the INotification to execute the associated ICommand for */ void executeCommand(INotification notification); /** - * Remove a previously registered ICommand to INotification mapping. + *

        Remove a previously registered ICommand to INotification mapping.

        * * @param notificationName the name of the INotification to remove the ICommand mapping for */ void removeCommand(String notificationName); /** - * Check if a Command is registered for a given Notification + *

        Check if a Command is registered for a given Notification

        * * @param notificationName notification name * @return whether a Command is currently registered for the given notificationName. diff --git a/src/org/puremvc/java/interfaces/IFacade.java b/src/main/java/org/puremvc/java/interfaces/IFacade.java similarity index 71% rename from src/org/puremvc/java/interfaces/IFacade.java rename to src/main/java/org/puremvc/java/interfaces/IFacade.java index c7a7331..6a4c917 100644 --- a/src/org/puremvc/java/interfaces/IFacade.java +++ b/src/main/java/org/puremvc/java/interfaces/IFacade.java @@ -10,20 +10,18 @@ import java.util.function.Supplier; /** - * The interface definition for a PureMVC Facade. + *

        The interface definition for a PureMVC Facade.

        * - *

        - * The Facade Pattern suggests providing a single + *

        The Facade Pattern suggests providing a single * class to act as a central point of communication - * for a subsystem.

        + * for a subsystem.

        * - *

        - * In PureMVC, the Facade acts as an interface between + *

        In PureMVC, the Facade acts as an interface between * the core MVC actors (Model, View, Controller) and * the rest of your application.

        * - * @see org.puremvc.java.interfaces.IModel IModel - * @see org.puremvc.java.interfaces.IView IView + * @see IModel IModel + * @see IView IView * @see org.puremvc.java.interfaces.IController IController * @see org.puremvc.java.interfaces.ICommand ICommand * @see org.puremvc.java.interfaces.INotification INotification @@ -31,14 +29,14 @@ public interface IFacade extends INotifier { /** - * Register an IProxy with the Model by name. + *

        Register an IProxy with the Model by name.

        * * @param proxy the IProxy to be registered with the Model. */ void registerProxy(IProxy proxy); /** - * Retrieve a IProxy from the Model by name. + *

        Retrieve a IProxy from the Model by name.

        * * @param proxyName the name of the IProxy instance to be retrieved. * @return the IProxy previously regisetered by proxyName with the Model. @@ -46,7 +44,7 @@ public interface IFacade extends INotifier { IProxy retrieveProxy(String proxyName); /** - * Remove an IProxy instance from the Model by name. + *

        Remove an IProxy instance from the Model by name.

        * * @param proxyName the IProxy to remove from the Model. * @return the IProxy that was removed from the Model @@ -54,7 +52,7 @@ public interface IFacade extends INotifier { IProxy removeProxy(String proxyName); /** - * Check if a Proxy is registered + *

        Check if a Proxy is registered

        * * @param proxyName proxy name * @return whether a Proxy is currently registered with the given proxyName. @@ -62,7 +60,7 @@ public interface IFacade extends INotifier { boolean hasProxy(String proxyName); /** - * Register an ICommand with the Controller. + *

        Register an ICommand with the Controller.

        * * @param notificationName the name of the INotification to associate the ICommand with. * @param commandSupplier a reference to the Command Supplier Function of the ICommand. @@ -70,14 +68,14 @@ public interface IFacade extends INotifier { void registerCommand(String notificationName, Supplier commandSupplier); /** - * Remove a previously registered ICommand to INotification mapping from the Controller. + *

        Remove a previously registered ICommand to INotification mapping from the Controller.

        * * @param notificationName the name of the INotification to remove the ICommand mapping for */ void removeCommand(String notificationName); /** - * Check if a Command is registered for a given Notification + *

        Check if a Command is registered for a given Notification

        * * @param notificationName notification name * @return whether a Command is currently registered for the given notificationName. @@ -85,14 +83,14 @@ public interface IFacade extends INotifier { boolean hasCommand(String notificationName); /** - * Register an IMediator instance with the View. + *

        Register an IMediator instance with the View.

        * * @param mediator a reference to the IMediator instance */ void registerMediator(IMediator mediator); /** - * Retrieve an IMediator instance from the View. + *

        Retrieve an IMediator instance from the View.

        * * @param mediatorName the name of the IMediator instance to retrievve * @return the IMediator previously registered with the given mediatorName. @@ -100,7 +98,7 @@ public interface IFacade extends INotifier { IMediator retrieveMediator(String mediatorName); /** - * Remove a IMediator instance from the View. + *

        Remove a IMediator instance from the View.

        * * @param mediatorName name of the IMediator instance to be removed. * @return the IMediator instance previously registered with the given mediatorName. @@ -108,7 +106,7 @@ public interface IFacade extends INotifier { IMediator removeMediator(String mediatorName); /** - * Check if a Mediator is registered or not + *

        Check if a Mediator is registered or not

        * * @param mediatorName mediator name * @return whether a Mediator is registered with the given mediatorName. @@ -116,14 +114,13 @@ public interface IFacade extends INotifier { boolean hasMediator(String mediatorName); /** - * Notify the IObservers for a particular INotification. + *

        Notify the IObservers for a particular INotification.

        * - *

        - * All previously attached IObservers for this INotification's + *

        All previously attached IObservers for this INotification's * list are notified and are passed a reference to the INotification in * the order in which they were registered.

        - *

        - * NOTE: Use this method only if you are sending custom Notifications. Otherwise + * + *

        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.

        * diff --git a/src/main/java/org/puremvc/java/interfaces/IMediator.java b/src/main/java/org/puremvc/java/interfaces/IMediator.java new file mode 100644 index 0000000..a7c7a0a --- /dev/null +++ b/src/main/java/org/puremvc/java/interfaces/IMediator.java @@ -0,0 +1,149 @@ +// +// PureMVC Java Standard +// +// Copyright(c) 2019 Saad Shams +// Your reuse is governed by the Creative Commons Attribution 3.0 License +// + +package org.puremvc.java.interfaces; + +/** + *

        The interface definition for a PureMVC Mediator.

        + * + *

        In PureMVC, IMediator implementors assume these responsibilities:

        + * + *
          + *
        • Implement a common method which returns a list of all INotifications + * the IMediator has interest in.
        • + *
        • Implement a notification callback method.
        • + *
        • Implement methods that are called when the IMediator is registered or removed from the View.
        • + *
        + * + *

        Additionally, IMediators typically:

        + * + *
          + *
        • Act as an intermediary between one or more view components such as text boxes or + * list controls, maintaining references and coordinating their behavior.
        • + *
        • In Flash-based apps, this is often the place where event listeners are + * added to view components, and their handlers implemented.
        • + *
        • Respond to and generate INotifications, interacting with of + * the rest of the PureMVC app.
        • + *
        + * + *

        When an IMediator is registered with the IView, + * the IView will call the IMediator's + * listNotificationInterests method. The IMediator will + * return an Array of INotification names which + * it wishes to be notified about.

        + * + *

        The IView will then create an Observer object + * encapsulating that IMediator's (handleNotification) method + * and register it as an Observer for each INotification name returned by + * listNotificationInterests.

        + * + *

        A concrete IMediator implementor usually looks something like this:

        + * + *
        + * {@code import org.puremvc.as3.multicore.patterns.mediator.*;
        + * import org.puremvc.as3.multicore.patterns.observer.*;
        + * import org.puremvc.as3.multicore.core.view.*;
        + *
        + * import com.me.myapp.model.*;
        + * import com.me.myapp.view.*;
        + * import com.me.myapp.controller.*;
        + *
        + * import javax.swing.JComboBox;
        + * import java.awt.event.ActionListener;
        + *
        + * public class MyMediator extends Mediator implements IMediator, ActionListener {
        + *
        + *     public MyMediator( Object viewComponent ) {
        + *         super( viewComponent );
        + *         combo.addActionListener( this );
        + *     }
        + *
        + *     public String[] listNotificationInterests() {
        + *         return [ MyFacade.SET_SELECTION,
        + *                  MyFacade.SET_DATAPROVIDER ];
        + *     }
        + *
        + *     public void handleNotification( INotification notification ) {
        + *         switch ( notification.getName() ) {
        + *             case MyFacade.SET_SELECTION:
        + *                 setSelection(notification);
        + *                 break;
        + *             case MyFacade.SET_DATAPROVIDER:
        + *                 setDataProvider(notification);
        + *                 break;
        + *         }
        + *     }
        + *
        + *     // Set the data provider of the combo box
        + *     protected void setDataProvider( INotification notification ) {
        + *         combo.setModel(ComboBoxModel(notification.getBody()));
        + *     }
        + *
        + *     // Invoked when the combo box dispatches a change event, we send a
        + *     // notification with the
        + *     public void actionPerformed(ActionEvent event) {
        + *         sendNotification( MyFacade.MYCOMBO_CHANGED, this );
        + *     }
        + *
        + *     // A private getter for accessing the view object by class
        + *     protected JComboBox getViewComponent() {
        + *         return viewComponent;
        + *     }
        + *
        + * }
        + * }
        + * 
        + * + * @see org.puremvc.java.interfaces.INotification INotification + */ +public interface IMediator extends INotifier { + + /** + *

        Get the IMediator instance name

        + * + * @return the IMediator instance name + */ + String getMediatorName(); + + /** + *

        Get the IMediator's view component.

        + * + * @return Object the view component + */ + Object getViewComponent(); + + /** + *

        Set the IMediator's view component.

        + * + * @param viewComponent the view component + */ + void setViewComponent(Object viewComponent); + + /** + *

        List INotification interests.

        + * + * @return an Array of the INotification names this IMediator has an interest in. + */ + String[] listNotificationInterests(); + + /** + *

        Handle an INotification.

        + * + * @param notification the INotification to be handled + */ + void handleNotification(INotification notification); + + /** + *

        Called by the View when the Mediator is registered

        + */ + void onRegister(); + + /** + *

        Called by the View when the Mediator is removed

        + */ + void onRemove(); +} diff --git a/src/org/puremvc/java/interfaces/IModel.java b/src/main/java/org/puremvc/java/interfaces/IModel.java similarity index 73% rename from src/org/puremvc/java/interfaces/IModel.java rename to src/main/java/org/puremvc/java/interfaces/IModel.java index 08175f6..181e4bd 100644 --- a/src/org/puremvc/java/interfaces/IModel.java +++ b/src/main/java/org/puremvc/java/interfaces/IModel.java @@ -8,14 +8,12 @@ package org.puremvc.java.interfaces; /** - * The interface definition for a PureMVC Model. + *

        The interface definition for a PureMVC Model.

        * - *

        - * In PureMVC, IModel implementors provide + *

        In PureMVC, IModel implementors provide * access to IProxy objects by named lookup.

        * - *

        - * An IModel assumes these responsibilities:

        + *

        An IModel assumes these responsibilities:

        * *
          *
        • Maintain a cache of IProxy instances
        • @@ -25,14 +23,14 @@ public interface IModel { /** - * Register an IProxy instance with the Model. + *

          Register an IProxy instance with the Model.

          * * @param proxy an object reference to be held by the Model. */ void registerProxy(IProxy proxy); /** - * Retrieve an IProxy instance from the Model. + *

          Retrieve an IProxy instance from the Model.

          * * @param proxyName proxy name * @return the IProxy instance previously registered with the given proxyName. @@ -40,7 +38,7 @@ public interface IModel { IProxy retrieveProxy(String proxyName); /** - * Remove an IProxy instance from the Model. + *

          Remove an IProxy instance from the Model.

          * * @param proxyName name of the IProxy instance to be removed. * @return the IProxy that was removed from the Model @@ -48,7 +46,7 @@ public interface IModel { IProxy removeProxy(String proxyName); /** - * Check if a Proxy is registered + *

          Check if a Proxy is registered

          * * @param proxyName proxy name * @return whether a Proxy is currently registered with the given proxyName. diff --git a/src/org/puremvc/java/interfaces/INotification.java b/src/main/java/org/puremvc/java/interfaces/INotification.java similarity index 67% rename from src/org/puremvc/java/interfaces/INotification.java rename to src/main/java/org/puremvc/java/interfaces/INotification.java index e997e4b..27c8f15 100644 --- a/src/org/puremvc/java/interfaces/INotification.java +++ b/src/main/java/org/puremvc/java/interfaces/INotification.java @@ -8,20 +8,17 @@ package org.puremvc.java.interfaces; /** - * The interface definition for a PureMVC Notification. + *

          The interface definition for a PureMVC Notification.

          * - *

          - * PureMVC does not rely upon underlying event models such + *

          PureMVC does not rely upon underlying event models such * as the one provided with Flash, and ActionScript 3 does * not have an inherent event model.

          * - *

          - * The Observer Pattern as implemented within PureMVC exists + *

          The Observer Pattern as implemented within PureMVC exists * to support event-driven communication between the * application and the actors of the MVC triad.

          * - *

          - * Notifications are not meant to be a replacement for Events + *

          Notifications are not meant to be a replacement for Events * in Flex/Flash/AIR. Generally, IMediator implementors * place event listeners on their view components, which they * then handle in the usual way. This may lead to the broadcast of Notifications to @@ -29,59 +26,58 @@ * instances communicate with each other and IMediators * by broadcasting INotifications.

          * - *

          - * A key difference between Flash Events and PureMVC + *

          A key difference between Flash Events and PureMVC * Notifications is that Events follow the * 'Chain of Responsibility' pattern, 'bubbling' up the display hierarchy * until some parent component handles the Event, while * PureMVC Notifications follow a 'Publish/Subscribe' * pattern. PureMVC classes need not be related to each other in a * parent/child relationship in order to communicate with one another - * using Notifications. + * using Notifications.

          * - * @see org.puremvc.java.interfaces.IView IView - * @see org.puremvc.java.interfaces.IObserver IObserver + * @see IView IView + * @see IObserver IObserver */ public interface INotification { /** - * Get the name of the INotification instance. - * No setter, should be set by constructor only + *

          Get the name of the INotification instance. + * No setter, should be set by constructor only

          * * @return notification name */ String getName(); /** - * Set the body of the INotification instance + *

          Set the body of the INotification instance

          * * @param body notification body */ void setBody(Object body); /** - * Get the body of the INotification instance + *

          Get the body of the INotification instance

          * * @return notification body */ Object getBody(); /** - * Set the type of the INotification instance + *

          Set the type of the INotification instance

          * * @param type notification type */ void setType(String type); /** - * Get the type of the INotification instance + *

          Get the type of the INotification instance

          * * @return notification type */ String getType(); /** - * Get the string representation of the INotification instance + *

          Get the string representation of the INotification instance

          * * @return string representation of INotification */ diff --git a/src/org/puremvc/java/interfaces/INotifier.java b/src/main/java/org/puremvc/java/interfaces/INotifier.java similarity index 68% rename from src/org/puremvc/java/interfaces/INotifier.java rename to src/main/java/org/puremvc/java/interfaces/INotifier.java index bf96e30..6dc3f8c 100644 --- a/src/org/puremvc/java/interfaces/INotifier.java +++ b/src/main/java/org/puremvc/java/interfaces/INotifier.java @@ -8,35 +8,31 @@ package org.puremvc.java.interfaces; /** - * The interface definition for a PureMVC Notifier. + *

          The interface definition for a PureMVC Notifier.

          * - *

          - * MacroCommand, Command, Mediator and Proxy - * all have a need to send Notifications.

          + *

          MacroCommand, Command, Mediator and Proxy + * all have a need to send Notifications.

          * - *

          - * The INotifier interface provides a common method called + *

          The INotifier interface provides a common method called * sendNotification that relieves implementation code of * the necessity to actually construct Notifications.

          * - *

          - * The Notifier class, which all of the above mentioned classes + *

          The Notifier class, which all of the above mentioned classes * extend, also provides an initialized reference to the Facade * Singleton, which is required for the convienience method * for sending Notifications, but also eases implementation as these * classes have frequent Facade interactions and usually require * access to the facade anyway.

          * - * @see org.puremvc.java.interfaces.IFacade IFacade + * @see IFacade IFacade * @see org.puremvc.java.interfaces.INotification INotification */ public interface INotifier { /** - * Send a INotification. + *

          Send a INotification.

          * - *

          - * Convenience method to prevent having to construct new + *

          Convenience method to prevent having to construct new * notification instances in our implementation code.

          * * @param notificationName the name of the notification to send @@ -46,10 +42,9 @@ public interface INotifier { void sendNotification(String notificationName, Object body, String type); /** - * Send a INotification. + *

          Send a INotification.

          * - *

          - * Convenience method to prevent having to construct new + *

          Convenience method to prevent having to construct new * notification instances in our implementation code.

          * * @param notificationName the name of the notification to send @@ -58,10 +53,9 @@ public interface INotifier { void sendNotification(String notificationName, Object body); /** - * Send a INotification. + *

          Send a INotification.

          * - *

          - * Convenience method to prevent having to construct new + *

          Convenience method to prevent having to construct new * notification instances in our implementation code.

          * * @param notificationName the name of the notification to send diff --git a/src/org/puremvc/java/interfaces/IObserver.java b/src/main/java/org/puremvc/java/interfaces/IObserver.java similarity index 72% rename from src/org/puremvc/java/interfaces/IObserver.java rename to src/main/java/org/puremvc/java/interfaces/IObserver.java index 634366c..95a4e53 100644 --- a/src/org/puremvc/java/interfaces/IObserver.java +++ b/src/main/java/org/puremvc/java/interfaces/IObserver.java @@ -10,10 +10,10 @@ import java.util.function.Consumer; /** - * The interface definition for a PureMVC Observer. + *

          The interface definition for a PureMVC Observer.

          + * + *

          In PureMVC, IObserver implementors assume these responsibilities:

          * - *

          - * In PureMVC, IObserver implementors assume these responsibilities: *

            *
          • Encapsulate the notification (callback) method of the interested object.
          • *
          • Encapsulate the notification context (this) of the interested object.
          • @@ -21,61 +21,56 @@ *
          • Provide a method for notifying the interested object.
          • *
          * - *

          - * PureMVC does not rely upon underlying event + *

          PureMVC does not rely upon underlying event * models such as the one provided with Flash, * and ActionScript 3 does not have an inherent * event model.

          * - *

          - * The Observer Pattern as implemented within + *

          The Observer Pattern as implemented within * PureMVC exists to support event driven communication * between the application and the actors of the * MVC triad.

          * - *

          - * An Observer is an object that encapsulates information + *

          An Observer is an object that encapsulates information * about an interested object with a notification method that * should be called when an INotification is broadcast. The Observer then - * acts as a proxy for notifying the interested object. + * acts as a proxy for notifying the interested object.

          * - *

          - * Observers can receive Notifications by having their + *

          Observers can receive Notifications by having their * notifyObserver method invoked, passing * in an object implementing the INotification interface, such * as a subclass of Notification.

          * - * @see org.puremvc.java.interfaces.IView IView + * @see IView IView * @see org.puremvc.java.interfaces.INotification INotification */ public interface IObserver { /** - * Set the notification method. + *

          Set the notification method.

          * - *

          - * The notification method should take one parameter of type INotification

          + *

          The notification method should take one parameter of type INotification

          * * @param notifyMethod the notification (callback) method of the interested object */ void setNotifyMethod(Consumer notifyMethod); /** - * Set the notification context. + *

          Set the notification context.

          * * @param notifyContext the notification context (this) of the interested object */ void setNotifyContext(Object notifyContext); /** - * Notify the interested object. + *

          Notify the interested object.

          * * @param notification the INotification to pass to the interested object's notification method */ void notifyObserver(INotification notification); /** - * Compare the given object to the notificaiton context object. + *

          Compare the given object to the notification context object.

          * * @param object the object to compare. * @return boolean indicating if the notification context and the object are the same. diff --git a/src/org/puremvc/java/interfaces/IProxy.java b/src/main/java/org/puremvc/java/interfaces/IProxy.java similarity index 74% rename from src/org/puremvc/java/interfaces/IProxy.java rename to src/main/java/org/puremvc/java/interfaces/IProxy.java index d61c553..98fc0b7 100644 --- a/src/org/puremvc/java/interfaces/IProxy.java +++ b/src/main/java/org/puremvc/java/interfaces/IProxy.java @@ -8,16 +8,17 @@ package org.puremvc.java.interfaces; /** - * The interface definition for a PureMVC Proxy. + *

          The interface definition for a PureMVC Proxy.

          + * + *

          In PureMVC, IProxy implementors assume these responsibilities:

          * - *

          - * In PureMVC, IProxy implementors assume these responsibilities:

          *
            *
          • Implement a common method which returns the name of the Proxy.
          • *
          • Provide methods for setting and getting the data object.
          • *
          - *

          - * Additionally, IProxys typically:

          + * + *

          Additionally, IProxys typically:

          + * *
            *
          • Maintain references to one or more pieces of model data.
          • *
          • Provide methods for manipulating that data.
          • @@ -29,33 +30,33 @@ public interface IProxy extends INotifier { /** - * Get the Proxy name + *

            Get the Proxy name

            * * @return the Proxy instance name */ String getProxyName(); /** - * Set the data object + *

            Set the data object

            * * @param data the data object */ void setData(Object data); /** - * Get the data object + *

            Get the data object

            * * @return the data as type Object */ Object getData(); /** - * Called by the Model when the Proxy is registered + *

            Called by the Model when the Proxy is registered

            */ void onRegister(); /** - * Called by the Model when the Proxy is removed + *

            Called by the Model when the Proxy is removed

            */ void onRemove(); } diff --git a/src/org/puremvc/java/interfaces/IView.java b/src/main/java/org/puremvc/java/interfaces/IView.java similarity index 74% rename from src/org/puremvc/java/interfaces/IView.java rename to src/main/java/org/puremvc/java/interfaces/IView.java index a8f5bd4..fe8a87a 100644 --- a/src/org/puremvc/java/interfaces/IView.java +++ b/src/main/java/org/puremvc/java/interfaces/IView.java @@ -8,13 +8,12 @@ package org.puremvc.java.interfaces; /** - * The interface definition for a PureMVC View. + *

            The interface definition for a PureMVC View.

            * - *

            - * In PureMVC, IView implementors assume these responsibilities:

            + *

            In PureMVC, IView implementors assume these responsibilities:

            + * + *

            In PureMVC, the View class assumes these responsibilities:

            * - *

            - * In PureMVC, the View class assumes these responsibilities: *

              *
            • Maintain a cache of IMediator instances.
            • *
            • Provide methods for registering, retrieving, and removing IMediators.
            • @@ -31,8 +30,8 @@ public interface IView { /** - * Register an IObserver to be notified - * of INotifications with a given name. + *

              Register an IObserver to be notified + * of INotifications with a given name.

              * * @param notificationName the name of the INotifications to notify this IObserver of * @param observer the IObserver to register @@ -40,18 +39,17 @@ public interface IView { void registerObserver(String notificationName, IObserver observer); /** - * Remove a group of observers from the observer list for a given Notification name. - *

              + *

              Remove a group of observers from the observer list for a given Notification name.

              + * * @param notificationName which observer list to remove from * @param notifyContext removed the observers with this object as their notifyContext */ void removeObserver(String notificationName, Object notifyContext); /** - * Notify the IObservers for a particular INotification. + *

              Notify the IObservers for a particular INotification.

              * - *

              - * All previously attached IObservers for this INotification's + *

              All previously attached IObservers for this INotification's * list are notified and are passed a reference to the INotification in * the order in which they were registered.

              * @@ -60,14 +58,13 @@ public interface IView { void notifyObservers(INotification notification); /** - * Register an IMediator instance with the View. + *

              Register an IMediator instance with the View.

              * - *

              - * Registers the IMediator so that it can be retrieved by name, + *

              Registers the IMediator so that it can be retrieved by name, * and further interrogates the IMediator for its * INotification interests.

              - *

              - * If the IMediator returns any INotification + * + *

              If the IMediator returns any INotification * names to be notified about, an Observer is created encapsulating * the IMediator instance's handleNotification method * and registering it as an Observer for all INotifications the @@ -78,7 +75,7 @@ public interface IView { void registerMediator(IMediator mediator); /** - * Retrieve an IMediator from the View. + *

              Retrieve an IMediator from the View.

              * * @param mediatorName the name of the IMediator instance to retrieve. * @return the IMediator instance previously registered with the given mediatorName. @@ -86,7 +83,7 @@ public interface IView { IMediator retrieveMediator(String mediatorName); /** - * Remove an IMediator from the View. + *

              Remove an IMediator from the View.

              * * @param mediatorName name of the IMediator instance to be removed. * @return the IMediator that was removed from the View @@ -94,7 +91,7 @@ public interface IView { IMediator removeMediator(String mediatorName); /** - * Check if a Mediator is registered or not + *

              Check if a Mediator is registered or not

              * * @param mediatorName mediator name * @return whether a Mediator is registered with the given mediatorName. diff --git a/src/org/puremvc/java/patterns/command/MacroCommand.java b/src/main/java/org/puremvc/java/patterns/command/MacroCommand.java similarity index 75% rename from src/org/puremvc/java/patterns/command/MacroCommand.java rename to src/main/java/org/puremvc/java/patterns/command/MacroCommand.java index 1cfb805..d180e27 100644 --- a/src/org/puremvc/java/patterns/command/MacroCommand.java +++ b/src/main/java/org/puremvc/java/patterns/command/MacroCommand.java @@ -15,28 +15,23 @@ import java.util.function.Supplier; /** - * A base ICommand implementation that executes other ICommands. + *

              A base ICommand implementation that executes other ICommands.

              * - *

              - * A MacroCommand maintains an list of + *

              A MacroCommand maintains an list of * ICommand Class references called SubCommands.

              * - *

              - * When execute is called, the MacroCommand + *

              When execute is called, the MacroCommand * instantiates and calls execute on each of its SubCommands turn. * Each SubCommand will be passed a reference to the original * INotification that was passed to the MacroCommand's * execute method.

              * - *

              - * Unlike SimpleCommand, your subclass + *

              Unlike SimpleCommand, your subclass * should not override execute, but instead, should * override the initializeMacroCommand method, * calling addSubCommand once for each SubCommand * to be executed.

              * - *

              - * * @see org.puremvc.java.core.Controller Controller * @see org.puremvc.java.patterns.observer.Notification Notification * @see org.puremvc.java.patterns.command.SimpleCommand SimpleCommand @@ -46,15 +41,13 @@ public class MacroCommand extends Notifier implements ICommand { private Vector> subCommands; /** - * Constructor. + *

              Constructor.

              * - *

              - * You should not need to define a constructor, + *

              You should not need to define a constructor, * instead, override the initializeMacroCommand * method.

              * - *

              - * If your subclass does define a constructor, be + *

              If your subclass does define a constructor, be * sure to call super().

              */ public MacroCommand() { @@ -63,10 +56,9 @@ public MacroCommand() { } /** - * Initialize the MacroCommand. + *

              Initialize the MacroCommand.

              * - *

              - * In your subclass, override this method to + *

              In your subclass, override this method to * initialize the MacroCommand's SubCommand * list with ICommand class references like * this:

              @@ -82,18 +74,17 @@ public MacroCommand() { * } * } *
  • - *

    - * Note that SubCommands may be any ICommand implementor, + * + *

    Note that SubCommands may be any ICommand implementor, * MacroCommands or SimpleCommands are both acceptable.

    */ protected void initializeMacroCommand() { } /** - * Add a SubCommand. + *

    Add a SubCommand.

    * - *

    - * The SubCommands will be called in First In/First Out (FIFO) + *

    The SubCommands will be called in First In/First Out (FIFO) * order.

    * * @param commandSupplier a reference to the commandSupplier of the ICommand. @@ -103,11 +94,10 @@ protected void addSubCommand(Supplier commandSupplier) { } /** - * Execute this MacroCommand's SubCommands. + *

    Execute this MacroCommand's SubCommands.

    * - *

    - * The SubCommands will be called in First In/First Out (FIFO) - * order. + *

    The SubCommands will be called in First In/First Out (FIFO) + * order.

    * * @param notification the INotification object to be passsed to each SubCommand. */ diff --git a/src/org/puremvc/java/patterns/command/SimpleCommand.java b/src/main/java/org/puremvc/java/patterns/command/SimpleCommand.java similarity index 73% rename from src/org/puremvc/java/patterns/command/SimpleCommand.java rename to src/main/java/org/puremvc/java/patterns/command/SimpleCommand.java index 0c8bfab..52f225c 100644 --- a/src/org/puremvc/java/patterns/command/SimpleCommand.java +++ b/src/main/java/org/puremvc/java/patterns/command/SimpleCommand.java @@ -12,23 +12,21 @@ import org.puremvc.java.patterns.observer.Notifier; /** - * A base ICommand implementation. + *

    A base ICommand implementation.

    * - *

    - * Your subclass should override the execute - * method where your business logic will handle the INotification.

    + *

    Your subclass should override the execute + * method where your business logic will handle the INotification.

    * * @see org.puremvc.java.core.Controller Controller * @see org.puremvc.java.patterns.observer.Notification Notification - * @see org.puremvc.java.patterns.command.MacroCommand MacroCommand + * @see MacroCommand MacroCommand */ public class SimpleCommand extends Notifier implements ICommand { /** - * Fulfill the use-case initiated by the given INotification. + *

    Fulfill the use-case initiated by the given INotification.

    * - *

    - * In the Command Pattern, an application use-case typically + *

    In the Command Pattern, an application use-case typically * begins with some user action, which results in an INotification being broadcast, which * is handled by business logic in the execute method of an * ICommand.

    diff --git a/src/org/puremvc/java/patterns/facade/Facade.java b/src/main/java/org/puremvc/java/patterns/facade/Facade.java similarity index 79% rename from src/org/puremvc/java/patterns/facade/Facade.java rename to src/main/java/org/puremvc/java/patterns/facade/Facade.java index 6b12999..f811365 100644 --- a/src/org/puremvc/java/patterns/facade/Facade.java +++ b/src/main/java/org/puremvc/java/patterns/facade/Facade.java @@ -16,11 +16,11 @@ import java.util.function.Supplier; /** - * A base Singleton IFacade implementation. + *

    A base Singleton IFacade implementation.

    + * + *

    In PureMVC, the Facade class assumes these + * responsibilities:

    * - *

    - * In PureMVC, the Facade class assumes these - * responsibilities: *

      *
    • Initializing the Model, View * and Controller Singletons.
    • @@ -31,8 +31,8 @@ *
    • Providing a single point of contact to the application for * registering Commands and notifying Observers
    • *
    - *

    - * Example usage: + * + *

    Example usage:

    *
      *  {@code
      *	import org.puremvc.as3.patterns.facade.Facade;
    @@ -126,9 +126,9 @@
      * }
      * 
    * - * @see org.puremvc.java.core.Model Model - * @see org.puremvc.java.core.View View - * @see org.puremvc.java.core.Controller Controller + * @see Model Model + * @see View View + * @see Controller Controller * @see org.puremvc.java.patterns.observer.Notification Notification * @see org.puremvc.java.patterns.mediator.Mediator Mediator * @see org.puremvc.java.patterns.proxy.Proxy Proxy @@ -149,13 +149,12 @@ public class Facade implements IFacade { protected final String SINGLETON_MSG = "Facade Singleton already constructed!"; /** - * Constructor. + *

    Constructor.

    * - *

    - * This IFacade implementation is a Singleton, + *

    This IFacade implementation is a Singleton, * so you should not call the constructor * directly, but instead call the static Singleton - * Factory method Facade.getInstance() + * Factory method Facade.getInstance()

    * * @throws Error Error if Singleton instance has already been constructed * @@ -167,10 +166,9 @@ public Facade() { } /** - * Initialize the Singleton Facade instance. + *

    Initialize the Singleton Facade instance.

    * - *

    - * Called automatically by the constructor. Override in your + *

    Called automatically by the constructor. Override in your * subclass to do any subclass specific initializations. Be * sure to call super.initializeFacade(), though.

    */ @@ -181,7 +179,7 @@ protected void initializeFacade() { } /** - * Facade Singleton Factory method + *

    Facade Singleton Factory method

    * * @param facadeSupplier facade Supplier Function * @return the Singleton instance of the Facade @@ -192,20 +190,20 @@ public synchronized static IFacade getInstance(Supplier facadeSupplier) } /** - * Initialize the Controller. + *

    Initialize the Controller.

    * - *

    - * Called by the initializeFacade method. + *

    Called by the initializeFacade method. * Override this method in your subclass of Facade * if one or both of the following are true:

    + * *
      *
    • You wish to initialize a different IController.
    • *
    • You have Commands to register with the Controller at startup.
    • *
    + * *

    If you don't want to initialize a different IController, * call super.initializeController() at the beginning of your - * method, then register Commands. - *

    + * method, then register Commands.

    */ protected void initializeController() { if(controller != null) return; @@ -213,27 +211,27 @@ protected void initializeController() { } /** - * Initialize the Model. + *

    Initialize the Model.

    * - *

    - * Called by the initializeFacade method. + *

    Called by the initializeFacade method. * Override this method in your subclass of Facade - * if one or both of the following are true: + * if one or both of the following are true:

    + * *
      *
    • You wish to initialize a different IModel.
    • *
    • You have Proxys to register with the Model that do not * retrieve a reference to the Facade at construction time.
    • *
    - * If you don't want to initialize a different IModel, + * + *

    If you don't want to initialize a different IModel, * call super.initializeModel() at the beginning of your - * method, then register Proxys. - *

    - * Note: This method is rarely overridden; in practice you are more + * method, then register Proxys.

    + * + *

    Note: This method is rarely overridden; in practice you are more * likely to use a Command to create and register Proxys * with the Model, since Proxys with mutable data will likely * need to send INotifications and thus will likely want to fetch a reference to - * the Facade during their construction. - *

    + * the Facade during their construction.

    */ protected void initializeModel() { if(model != null) return; @@ -241,26 +239,26 @@ protected void initializeModel() { } /** - * Initialize the View. + *

    Initialize the View.

    * - *

    - * Called by the initializeFacade method. + *

    Called by the initializeFacade method. * Override this method in your subclass of Facade - * if one or both of the following are true: + * if one or both of the following are true:

    + * *
      *
    • You wish to initialize a different IView.
    • *
    • You have Observers to register with the View
    • *
    - *

    If you don't want to initialize a different IView, + * + *

    If you don't want to initialize a different IView, * call super.initializeView() at the beginning of your - * method, then register IMediator instances.

    - *

    - * Note: This method is rarely overridden; in practice you are more + * method, then register IMediator instances.

    + * + *

    Note: This method is rarely overridden; in practice you are more * likely to use a Command to create and register Mediators * with the View, since IMediator instances will need to send * INotifications and thus will likely want to fetch a reference - * to the Facade during their construction. - *

    + * to the Facade during their construction.

    */ protected void initializeView() { if(view != null) return; @@ -268,7 +266,7 @@ protected void initializeView() { } /** - * Register an ICommand with the Controller by Notification name. + *

    Register an ICommand with the Controller by Notification name.

    * * @param notificationName the name of the INotification to associate the ICommand with * @param commandSupplier a reference to the Supplier Function of the ICommand @@ -278,7 +276,7 @@ public void registerCommand(String notificationName, Supplier commandS } /** - * Remove a previously registered ICommand to INotification mapping from the Controller. + *

    Remove a previously registered ICommand to INotification mapping from the Controller.

    * * @param notificationName the name of the INotification to remove the ICommand mapping for */ @@ -287,7 +285,7 @@ public void removeCommand(String notificationName) { } /** - * Check if a Command is registered for a given Notification + *

    Check if a Command is registered for a given Notification

    * * @param notificationName notification name * @return whether a Command is currently registered for the given notificationName. @@ -297,7 +295,7 @@ public boolean hasCommand(String notificationName) { } /** - * Register an IProxy with the Model by name. + *

    Register an IProxy with the Model by name.

    * * @param proxy the IProxy instance to be registered with the Model. */ @@ -306,7 +304,7 @@ public void registerProxy(IProxy proxy) { } /** - * Retrieve an IProxy from the Model by name. + *

    Retrieve an IProxy from the Model by name.

    * * @param proxyName the name of the proxy to be retrieved. * @return the IProxy instance previously registered with the given proxyName. @@ -316,7 +314,7 @@ public IProxy retrieveProxy(String proxyName) { } /** - * Remove an IProxy from the Model by name. + *

    Remove an IProxy from the Model by name.

    * * @param proxyName the IProxy to remove from the Model. * @return the IProxy that was removed from the Model @@ -326,7 +324,7 @@ public IProxy removeProxy(String proxyName) { } /** - * Check if a Proxy is registered + *

    Check if a Proxy is registered

    * * @param proxyName proxy name * @return whether a Proxy is currently registered with the given proxyName. @@ -336,7 +334,7 @@ public boolean hasProxy(String proxyName) { } /** - * Register a IMediator with the View. + *

    Register a IMediator with the View.

    * * @param mediator a reference to the IMediator */ @@ -345,7 +343,7 @@ public void registerMediator(IMediator mediator) { } /** - * Retrieve an IMediator from the View. + *

    Retrieve an IMediator from the View.

    * * @param mediatorName mediator name * @return the IMediator previously registered with the given mediatorName. @@ -355,7 +353,7 @@ public IMediator retrieveMediator(String mediatorName) { } /** - * Remove an IMediator from the View. + *

    Remove an IMediator from the View.

    * * @param mediatorName name of the IMediator to be removed. * @return the IMediator that was removed from the View @@ -365,7 +363,7 @@ public IMediator removeMediator(String mediatorName) { } /** - * Check if a Mediator is registered or not + *

    Check if a Mediator is registered or not

    * * @param mediatorName mediator name * @return whether a Mediator is registered with the given mediatorName. @@ -375,11 +373,11 @@ public boolean hasMediator(String mediatorName) { } /** - * Create and send an INotification. + *

    Create and send an INotification.

    + * + *

    Keeps us from having to construct new notification + * instances in our implementation code.

    * - *

    - * Keeps us from having to construct new notification - * instances in our implementation code. * @param notificationName the name of the notiification to send * @param body the body of the notification * @param type the type of the notification @@ -389,11 +387,11 @@ public void sendNotification(String notificationName, Object body, String type) } /** - * Create and send an INotification. + *

    Create and send an INotification.

    + * + *

    Keeps us from having to construct new notification + * instances in our implementation code.

    * - *

    - * Keeps us from having to construct new notification - * instances in our implementation code. * @param notificationName the name of the notiification to send * @param body the body of the notification */ @@ -402,11 +400,11 @@ public void sendNotification(String notificationName, Object body) { } /** - * Create and send an INotification. + *

    Create and send an INotification.

    + * + *

    Keeps us from having to construct new notification + * instances in our implementation code.

    * - *

    - * Keeps us from having to construct new notification - * instances in our implementation code. * @param notificationName the name of the notiification to send */ public void sendNotification(String notificationName) { @@ -414,13 +412,13 @@ public void sendNotification(String notificationName) { } /** - * Notify Observers. - *

    - * This method is left public mostly for backward + *

    Notify Observers.

    + * + *

    This method is left public mostly for backward * compatibility, and to allow you to send custom * notification classes using the facade.

    - *

    - * Usually you should just call sendNotification + * + *

    Usually you should just call sendNotification * and pass the parameters, never having to * construct the notification yourself.

    * diff --git a/src/org/puremvc/java/patterns/mediator/Mediator.java b/src/main/java/org/puremvc/java/patterns/mediator/Mediator.java similarity index 74% rename from src/org/puremvc/java/patterns/mediator/Mediator.java rename to src/main/java/org/puremvc/java/patterns/mediator/Mediator.java index f79fe88..76a7e9b 100644 --- a/src/org/puremvc/java/patterns/mediator/Mediator.java +++ b/src/main/java/org/puremvc/java/patterns/mediator/Mediator.java @@ -12,17 +12,16 @@ import org.puremvc.java.patterns.observer.Notifier; /** - * A base IMediator implementation. + *

    A base IMediator implementation.

    * * @see org.puremvc.java.core.View View */ public class Mediator extends Notifier implements IMediator { /** - * The name of the Mediator. + *

    The name of the Mediator.

    * - *

    - * Typically, a Mediator will be written to serve + *

    Typically, a Mediator will be written to serve * one specific control or group controls and so, * will not have a need to be dynamically named.

    */ @@ -35,7 +34,7 @@ public class Mediator extends Notifier implements IMediator { protected Object viewComponent; /** - * Constructor. + *

    Constructor.

    * * @param mediatorName mediator name * @param viewComponent view component @@ -46,7 +45,7 @@ public Mediator(String mediatorName, Object viewComponent) { } /** - * Constructor. + *

    Constructor.

    * * @param mediatorName mediator name */ @@ -55,15 +54,15 @@ public Mediator(String mediatorName) { } /** - * Constructor. + *

    Constructor.

    */ public Mediator() { this(null, null); } /** - * List the INotification names this - * Mediator is interested in being notified of. + *

    List the INotification names this + * Mediator is interested in being notified of.

    * * @return Array the list of INotification names */ @@ -72,33 +71,33 @@ public String[] listNotificationInterests() { } /** - * Handle INotifications. + *

    Handle INotifications.

    * - *

    - * Typically this will be handled in a switch statement, + *

    Typically this will be handled in a switch statement, * with one 'case' entry per INotification - * the Mediator is interested in. + * the Mediator is interested in.

    */ public void handleNotification(INotification notification) { } /** - * Called by the View when the Mediator is registered + *

    Called by the View when the Mediator is registered

    */ public void onRegister() { } /** - * Called by the View when the Mediator is removed + *

    Called by the View when the Mediator is removed

    */ public void onRemove() { } /** - * Get the name of the Mediator. + *

    Get the name of the Mediator.

    + * * @return the Mediator name */ public String getMediatorName() { @@ -106,10 +105,9 @@ public String getMediatorName() { } /** - * Get the Mediator's view component. + *

    Get the Mediator's view component.

    * - *

    - * Additionally, an implicit getter will usually + *

    Additionally, an implicit getter will usually * be defined in the subclass that casts the view * object to a type, like this:

    * @@ -127,7 +125,7 @@ public Object getViewComponent() { } /** - * Set the IMediator's view component. + *

    Set the IMediator's view component.

    * * @param viewComponent the view component */ diff --git a/src/org/puremvc/java/patterns/observer/Notification.java b/src/main/java/org/puremvc/java/patterns/observer/Notification.java similarity index 78% rename from src/org/puremvc/java/patterns/observer/Notification.java rename to src/main/java/org/puremvc/java/patterns/observer/Notification.java index a020266..3929f90 100644 --- a/src/org/puremvc/java/patterns/observer/Notification.java +++ b/src/main/java/org/puremvc/java/patterns/observer/Notification.java @@ -10,20 +10,17 @@ import org.puremvc.java.interfaces.INotification; /** - * A base INotification implementation. + *

    A base INotification implementation.

    * - *

    - * PureMVC does not rely upon underlying event models such + *

    PureMVC does not rely upon underlying event models such * as the one provided with Flash, and ActionScript 3 does * not have an inherent event model.

    * - *

    - * The Observer Pattern as implemented within PureMVC exists + *

    The Observer Pattern as implemented within PureMVC exists * to support event-driven communication between the * application and the actors of the MVC triad.

    * - *

    - * Notifications are not meant to be a replacement for Events + *

    Notifications are not meant to be a replacement for Events * in Flex/Flash/Apollo. Generally, IMediator implementors * place event listeners on their view components, which they * then handle in the usual way. This may lead to the broadcast of Notifications to @@ -31,17 +28,16 @@ * instances communicate with each other and IMediators * by broadcasting INotifications.

    * - *

    - * A key difference between Flash Events and PureMVC + *

    A key difference between Flash Events and PureMVC * Notifications is that Events follow the * 'Chain of Responsibility' pattern, 'bubbling' up the display hierarchy * until some parent component handles the Event, while * PureMVC Notifications follow a 'Publish/Subscribe' * pattern. PureMVC classes need not be related to each other in a * parent/child relationship in order to communicate with one another - * using Notifications. + * using Notifications.

    * - * @see org.puremvc.java.patterns.observer.Observer Observer + * @see Observer Observer * */ public class Notification implements INotification { @@ -56,7 +52,7 @@ public class Notification implements INotification { private Object body; /** - * Constructor. + *

    Constructor.

    * * @param name name of the Notification instance. (required) * @param body the Notification body. @@ -69,7 +65,7 @@ public Notification(String name, Object body, String type) { } /** - * Constructor. + *

    Constructor.

    * * @param name name of the Notification instance. * @param body the Notification body. @@ -79,7 +75,7 @@ public Notification(String name, Object body) { } /** - * Constructor. + *

    Constructor.

    * * @param name name of the Notification instance. */ @@ -88,7 +84,7 @@ public Notification(String name) { } /** - * Get the name of the Notification instance. + *

    Get the name of the Notification instance.

    * * @return the name of the Notification instance. */ @@ -97,14 +93,14 @@ public String getName() { } /** - * Set the body of the Notification instance. + *

    Set the body of the Notification instance.

    */ public void setBody(Object body) { this.body = body; } /** - * Get the body of the Notification instance. + *

    Get the body of the Notification instance.

    * * @return the body object. */ @@ -113,14 +109,14 @@ public Object getBody() { } /** - * Set the type of the Notification instance. + *

    Set the type of the Notification instance.

    */ public void setType(String type) { this.type = type; } /** - * Get the type of the Notification instance. + *

    Get the type of the Notification instance.

    * * @return the type */ @@ -129,7 +125,7 @@ public String getType() { } /** - * Get the string representation of the Notification instance. + *

    Get the string representation of the Notification instance.

    * * @return the string representation of the Notification instance. */ diff --git a/src/org/puremvc/java/patterns/observer/Notifier.java b/src/main/java/org/puremvc/java/patterns/observer/Notifier.java similarity index 65% rename from src/org/puremvc/java/patterns/observer/Notifier.java rename to src/main/java/org/puremvc/java/patterns/observer/Notifier.java index 287c892..f47caa8 100644 --- a/src/org/puremvc/java/patterns/observer/Notifier.java +++ b/src/main/java/org/puremvc/java/patterns/observer/Notifier.java @@ -12,28 +12,23 @@ import org.puremvc.java.patterns.facade.Facade; /** - * A Base INotifier implementation. + *

    A Base INotifier implementation.

    * - *

    - * MacroCommand, Command, Mediator and Proxy all - * have a need to send Notifications. - *

    - *

    - * The INotifier interface provides a common method called + *

    MacroCommand, Command, Mediator and Proxy all + * have a need to send Notifications.

    + * + *

    The INotifier interface provides a common method called * sendNotification that relieves implementation code of the - * necessity to actually construct Notifications. - *

    + * necessity to actually construct Notifications.

    * - *

    - * The Notifier class, which all of the above mentioned classes + *

    The Notifier class, which all of the above mentioned classes * extend, provides an initialized reference to the Facade * Singleton, which is required for the convienience method for sending * Notifications, but also eases implementation as these classes * have frequent Facade interactions and usually require access - * to the facade anyway. - *

    + * to the facade anyway.

    * - * @see org.puremvc.java.patterns.facade.Facade Facade + * @see Facade Facade * @see org.puremvc.java.patterns.mediator.Mediator Mediator * @see org.puremvc.java.patterns.proxy.Proxy Proxy * @see org.puremvc.java.patterns.command.SimpleCommand SimpleCommand @@ -42,16 +37,15 @@ public class Notifier implements INotifier { /** - * Local reference to the Facade Singleton + *

    Local reference to the Facade Singleton

    */ protected IFacade facade = Facade.getInstance(()-> new Facade()); /** - * Send an INotifications. + *

    Send an INotifications.

    * - *

    - * Keeps us from having to construct new notification instances in our - * implementation code. + *

    Keeps us from having to construct new notification instances in our + * implementation code.

    * * @param notificationName the name of the notiification to send * @param body the body of the notification @@ -62,11 +56,10 @@ public void sendNotification(String notificationName, Object body, String type) } /** - * Send an INotifications. + *

    Send an INotifications.

    * - *

    - * Keeps us from having to construct new notification instances in our - * implementation code. + *

    Keeps us from having to construct new notification instances in our + * implementation code.

    * * @param notificationName the name of the notiification to send * @param body the body of the notification @@ -76,11 +69,10 @@ public void sendNotification(String notificationName, Object body) { } /** - * Send an INotifications. + *

    Send an INotifications.

    * - *

    - * Keeps us from having to construct new notification instances in our - * implementation code. + *

    Keeps us from having to construct new notification instances in our + * implementation code.

    * * @param notificationName the name of the notiification to send */ diff --git a/src/org/puremvc/java/patterns/observer/Observer.java b/src/main/java/org/puremvc/java/patterns/observer/Observer.java similarity index 78% rename from src/org/puremvc/java/patterns/observer/Observer.java rename to src/main/java/org/puremvc/java/patterns/observer/Observer.java index 8bda34b..aa8fb33 100644 --- a/src/org/puremvc/java/patterns/observer/Observer.java +++ b/src/main/java/org/puremvc/java/patterns/observer/Observer.java @@ -13,15 +13,14 @@ import java.util.function.Consumer; /** - * A base IObserver implementation. + *

    A base IObserver implementation.

    * - *

    - * An Observer is an object that encapsulates information + *

    An Observer is an object that encapsulates information * about an interested object with a method that should - * be called when a particular INotification is broadcast.

    + * be called when a particular INotification is broadcast.

    + * + *

    In PureMVC, the Observer class assumes these responsibilities:

    * - *

    - * In PureMVC, the Observer class assumes these responsibilities: *

      *
    • Encapsulate the notification (callback) method of the interested object.
    • *
    • Encapsulate the notification context (this) of the interested object.
    • @@ -39,12 +38,10 @@ public class Observer implements IObserver { private Consumer notifyMethod; /** - * Constructor. + *

      Constructor.

      * - *

      - * The notification method on the interested object should take one - * parameter of type INotification - *

      + *

      The notification method on the interested object should take one + * parameter of type INotification

      * * @param notifyMethod the notification method of the interested object * @param notifyContext the notification context of the interested object @@ -55,7 +52,7 @@ public Observer(Consumer notifyMethod, Object notifyContext) { } /** - * Compare an object to the notification context. + *

      Compare an object to the notification context.

      * * @param object the object to compare * @return boolean indicating if the object and the notification context are @@ -66,7 +63,7 @@ public boolean compareNotifyContext(Object object) { } /** - * Notify the interested object. + *

      Notify the interested object.

      * * @param notification the INotification to pass to the interested * object's notification method. @@ -76,7 +73,7 @@ public void notifyObserver(INotification notification) { } /** - * Get the notification context. + *

      Get the notification context.

      * * @return the notification context (this) of the * interested object. @@ -86,7 +83,7 @@ protected Object getNotifyContext() { } /** - * Set the notification context. + *

      Set the notification context.

      * * @param notifyContext the notification context (this) of the interested object. */ @@ -95,7 +92,7 @@ public void setNotifyContext(Object notifyContext) { } /** - * Get the notification method. + *

      Get the notification method.

      * * @return the notification (callback) consumer function of the interested object. */ @@ -104,12 +101,10 @@ protected Consumer getNotifyMethod() { } /** - * Set the notification method. + *

      Set the notification method.

      * - *

      - * The notification method should take one parameter of type - * INotification. - *

      + *

      The notification method should take one parameter of type + * INotification.

      * * @param notifyMethod the notification (callback) consumer function of the interested object. */ diff --git a/src/org/puremvc/java/patterns/proxy/Proxy.java b/src/main/java/org/puremvc/java/patterns/proxy/Proxy.java similarity index 71% rename from src/org/puremvc/java/patterns/proxy/Proxy.java rename to src/main/java/org/puremvc/java/patterns/proxy/Proxy.java index 928f950..3b8636d 100644 --- a/src/org/puremvc/java/patterns/proxy/Proxy.java +++ b/src/main/java/org/puremvc/java/patterns/proxy/Proxy.java @@ -11,26 +11,20 @@ import org.puremvc.java.patterns.observer.Notifier; /** - * A base IProxy implementation. + *

      A base IProxy implementation.

      * - *

      - * In PureMVC, Proxy classes are used to manage parts of the - * application's data model. - *

      + *

      In PureMVC, Proxy classes are used to manage parts of the + * application's data model.

      * - *

      - * A Proxy might simply manage a reference to a local data + *

      A Proxy might simply manage a reference to a local data * object, in which case interacting with it might involve setting and getting - * of its data in synchronous fashion. - *

      + * of its data in synchronous fashion.

      * - *

      - * Proxy classes are also used to encapsulate the application's + *

      Proxy classes are also used to encapsulate the application's * interaction with remote services to save or retrieve data, in which case, we * adopt an asyncronous idiom; setting data (or calling a method) on the * Proxy and listening for a Notification to be - * sent when the Proxy has retrieved the data from the service. - *

      + * sent when the Proxy has retrieved the data from the service.

      * * @see org.puremvc.java.core.Model Model */ @@ -46,7 +40,8 @@ public class Proxy extends Notifier implements IProxy { protected Object data; /** - * Constructor + *

      Constructor

      + * * @param proxyName proxy name * @param data data object */ @@ -56,33 +51,38 @@ public Proxy(String proxyName, Object data) { } /** - * Constructor + *

      Constructor

      + * * @param proxyName Name of the Proxy */ public Proxy(String proxyName) { this(proxyName, null); } + /** + *

      Constructor

      + */ public Proxy(){ this(null, null); } /** - * Called by the Model when the Proxy is registered + *

      Called by the Model when the Proxy is registered

      */ public void onRegister() { } /** - * Called by the Model when the Proxy is removed + *

      Called by the Model when the Proxy is removed

      */ public void onRemove() { } /** - * Get the proxy name + *

      Get the proxy name

      + * * @return the proxy name */ public String getProxyName() { @@ -90,7 +90,8 @@ public String getProxyName() { } /** - * Get the data object + *

      Get the data object

      + * * @return the data object */ public Object getData() { @@ -98,7 +99,8 @@ public Object getData() { } /** - * Set the data object + *

      Set the data object

      + * * @param data data object */ public void setData(Object data) { diff --git a/src/org/puremvc/java/interfaces/IMediator.java b/src/org/puremvc/java/interfaces/IMediator.java deleted file mode 100644 index 1f2c534..0000000 --- a/src/org/puremvc/java/interfaces/IMediator.java +++ /dev/null @@ -1,152 +0,0 @@ -// -// PureMVC Java Standard -// -// Copyright(c) 2019 Saad Shams -// Your reuse is governed by the Creative Commons Attribution 3.0 License -// - -package org.puremvc.java.interfaces; - -/** - * The interface definition for a PureMVC Mediator. - * - *

      - * In PureMVC, IMediator implementors assume these responsibilities:

      - *
        - *
      • Implement a common method which returns a list of all INotifications - * the IMediator has interest in.
      • - *
      • Implement a notification callback method.
      • - *
      • Implement methods that are called when the IMediator is registered or removed from the View.
      • - *
      - *

      - * Additionally, IMediators typically: - *

      - *
        - *
      • Act as an intermediary between one or more view components such as text boxes or - * list controls, maintaining references and coordinating their behavior.
      • - *
      • In Flash-based apps, this is often the place where event listeners are - * added to view components, and their handlers implemented.
      • - *
      • Respond to and generate INotifications, interacting with of - * the rest of the PureMVC app. - *
      - *

      - * When an IMediator is registered with the IView, - * the IView will call the IMediator's - * listNotificationInterests method. The IMediator will - * return an Array of INotification names which - * it wishes to be notified about.

      - * - *

      - * The IView will then create an Observer object - * encapsulating that IMediator's (handleNotification) method - * and register it as an Observer for each INotification name returned by - * listNotificationInterests.

      - * - *

      - * A concrete IMediator implementor usually looks something like this:

      - * - *
      - * {@code
      - *	import org.puremvc.as3.multicore.patterns.mediator.*;
      - *	import org.puremvc.as3.multicore.patterns.observer.*;
      - *	import org.puremvc.as3.multicore.core.view.*;
      - *
      - *	import com.me.myapp.model.*;
      - *	import com.me.myapp.view.*;
      - *	import com.me.myapp.controller.*;
      - *
      - *	import javax.swing.JComboBox;
      - *	import java.awt.event.ActionListener;
      - *
      - *        public class MyMediator extends Mediator implements IMediator, ActionListener {
      - *
      - * 		public MyMediator( Object viewComponent ) {
      - * 			super( viewComponent );
      - * 			combo.addActionListener( this );
      - * 		}
      - *
      - * 		public String[] listNotificationInterests() {
      - * 			return [ MyFacade.SET_SELECTION,
      - * 						 MyFacade.SET_DATAPROVIDER ];
      - * 		}
      - *
      - * 		public void handleNotification( INotification notification ) {
      - *  			switch ( notification.getName() ) {
      - * 			        case MyFacade.SET_SELECTION:
      - * 			          setSelection(notification);
      - * 			          break;
      - * 			        case MyFacade.SET_DATAPROVIDER:
      - * 			          setDataProvider(notification);
      - * 			          break;
      - *  			}
      - * 		}
      - *
      - * 		// Set the data provider of the combo box
      - * 		protected void setDataProvider( INotification notification ) {
      - * 			combo.setModel(ComboBoxModel(notification.getBody()));
      - * 		}
      - *
      - * 		// Invoked when the combo box dispatches a change event, we send a
      - * 		// notification with the
      - * 		public void actionPerformed(ActionEvent event) {
      - * 			sendNotification( MyFacade.MYCOMBO_CHANGED, this );
      - * 		}
      - *
      - * 		// A private getter for accessing the view object by class
      - * 		protected JComboBox getViewComponent() {
      - * 			return viewComponent;
      - * 		}
      - *
      - *        }
      - * }
      - * 
      - * - * @see org.puremvc.java.interfaces.INotification INotification - */ -public interface IMediator extends INotifier { - - /** - * Get the IMediator instance name - * - * @return the IMediator instance name - */ - String getMediatorName(); - - /** - * Get the IMediator's view component. - * - * @return Object the view component - */ - Object getViewComponent(); - - /** - * Set the IMediator's view component. - * - * @param viewComponent the view component - */ - void setViewComponent(Object viewComponent); - - /** - * List INotification interests. - * - * @return an Array of the INotification names this IMediator has an interest in. - */ - String[] listNotificationInterests(); - - /** - * Handle an INotification. - * - * @param notification the INotification to be handled - */ - void handleNotification(INotification notification); - - /** - * Called by the View when the Mediator is registered - */ - void onRegister(); - - /** - * Called by the View when the Mediator is removed - */ - void onRemove(); -} diff --git a/tests/org/puremvc/java/core/ControllerTest.java b/src/test/java/org/puremvc/java/core/ControllerTest.java similarity index 95% rename from tests/org/puremvc/java/core/ControllerTest.java rename to src/test/java/org/puremvc/java/core/ControllerTest.java index 8d424d5..c476e9b 100644 --- a/tests/org/puremvc/java/core/ControllerTest.java +++ b/src/test/java/org/puremvc/java/core/ControllerTest.java @@ -38,13 +38,11 @@ public void testGetInstance() { /** * Tests Command registration and execution. * - *

      - * This test gets the Singleton Controller instance + *

      This test gets the Singleton Controller instance * and registers the ControllerTestCommand class * to handle 'ControllerTest' Notifications.

      * - *

      - * It then constructs such a Notification and tells the + *

      It then constructs such a Notification and tells the * Controller to execute the associated Command. * Success is determined by evaluating a property * on an object passed to the Command, which will @@ -73,8 +71,7 @@ public void testRegisterAndExecuteCommand() { /** * Tests Command registration and removal. * - *

      - * Tests that once a Command is registered and verified + *

      Tests that once a Command is registered and verified * working, it can be removed from the Controller.

      */ @Test @@ -132,8 +129,7 @@ public void testHasCommand() { /** * Tests Removing and Reregistering a Command * - *

      - * Tests that when a Command is re-registered that it isn't fired twice. + *

      Tests that when a Command is re-registered that it isn't fired twice. * This involves, minimally, registration with the controller but * notification via the View, rather than direct execution of * the Controller's executeCommand method as is done above in diff --git a/tests/org/puremvc/java/core/ControllerTestCommand.java b/src/test/java/org/puremvc/java/core/ControllerTestCommand.java similarity index 85% rename from tests/org/puremvc/java/core/ControllerTestCommand.java rename to src/test/java/org/puremvc/java/core/ControllerTestCommand.java index db7c519..3d0b8a3 100644 --- a/tests/org/puremvc/java/core/ControllerTestCommand.java +++ b/src/test/java/org/puremvc/java/core/ControllerTestCommand.java @@ -13,8 +13,8 @@ /** * A SimpleCommand subclass used by ControllerTest. * - * @see org.puremvc.java.core.ControllerTest ControllerTest - * @see org.puremvc.java.core.ControllerTestVO ControllerTestVO + * @see ControllerTest ControllerTest + * @see ControllerTestVO ControllerTestVO */ public class ControllerTestCommand extends SimpleCommand { diff --git a/tests/org/puremvc/java/core/ControllerTestCommand2.java b/src/test/java/org/puremvc/java/core/ControllerTestCommand2.java similarity index 77% rename from tests/org/puremvc/java/core/ControllerTestCommand2.java rename to src/test/java/org/puremvc/java/core/ControllerTestCommand2.java index 7a8f480..ad1c26c 100644 --- a/tests/org/puremvc/java/core/ControllerTestCommand2.java +++ b/src/test/java/org/puremvc/java/core/ControllerTestCommand2.java @@ -13,15 +13,15 @@ /** * A SimpleCommand subclass used by ControllerTest. * - * @see org.puremvc.java.core.ControllerTest ControllerTest - * @see org.puremvc.java.core.ControllerTestVO ControllerTestVO + * @see ControllerTest ControllerTest + * @see ControllerTestVO ControllerTestVO */ public class ControllerTestCommand2 extends SimpleCommand { /** * Fabricate a result by multiplying the input by 2 and adding to the existing result - *

      - * This tests accumulation effect that would show if the command were executed more than once. + * + *

      This tests accumulation effect that would show if the command were executed more than once.

      * @param notification the note carrying the ControllerTestVO */ public void execute(INotification notification) { diff --git a/tests/org/puremvc/java/core/ControllerTestVO.java b/src/test/java/org/puremvc/java/core/ControllerTestVO.java similarity index 90% rename from tests/org/puremvc/java/core/ControllerTestVO.java rename to src/test/java/org/puremvc/java/core/ControllerTestVO.java index 87e8904..e57643c 100644 --- a/tests/org/puremvc/java/core/ControllerTestVO.java +++ b/src/test/java/org/puremvc/java/core/ControllerTestVO.java @@ -10,7 +10,7 @@ /** * A utility class used by ControllerTest. * - * @see org.puremvc.java.core.ControllerTest ControllerTest + * @see ControllerTest ControllerTest * @see org.puremvc.java.core.ControllerTestCommand ControllerTestCommand */ public class ControllerTestVO { diff --git a/tests/org/puremvc/java/core/ModelTest.java b/src/test/java/org/puremvc/java/core/ModelTest.java similarity index 97% rename from tests/org/puremvc/java/core/ModelTest.java rename to src/test/java/org/puremvc/java/core/ModelTest.java index b4d4eb4..fbecdd9 100644 --- a/tests/org/puremvc/java/core/ModelTest.java +++ b/src/test/java/org/puremvc/java/core/ModelTest.java @@ -31,8 +31,7 @@ public void testGetInstance() { /** * Tests the proxy registration and retrieval methods. * - *

      - * Tests registerProxy and retrieveProxy in the same test. + *

      Tests registerProxy and retrieveProxy in the same test. * These methods cannot currently be tested separately * in any meaningful way other than to show that the * methods do not throw exception when called.

      diff --git a/tests/org/puremvc/java/core/ModelTestProxy.java b/src/test/java/org/puremvc/java/core/ModelTestProxy.java similarity index 100% rename from tests/org/puremvc/java/core/ModelTestProxy.java rename to src/test/java/org/puremvc/java/core/ModelTestProxy.java diff --git a/tests/org/puremvc/java/core/ViewTest.java b/src/test/java/org/puremvc/java/core/ViewTest.java similarity index 99% rename from tests/org/puremvc/java/core/ViewTest.java rename to src/test/java/org/puremvc/java/core/ViewTest.java index a72a6cf..0b34eb9 100644 --- a/tests/org/puremvc/java/core/ViewTest.java +++ b/src/test/java/org/puremvc/java/core/ViewTest.java @@ -49,16 +49,14 @@ public void testGetInstance() { /** * Tests registration and notification of Observers. * - *

      - * An Observer is created to callback the viewTestMethod of + *

      An Observer is created to callback the viewTestMethod of * this ViewTest instance. This Observer is registered with * the View to be notified of 'ViewTestEvent' events. Such * an event is created, and a value set on its payload. Then * the View is told to notify interested observers of this * Event. * - *

      - * The View calls the Observer's notifyObserver method + *

      The View calls the Observer's notifyObserver method * which calls the viewTestMethod on this instance * of the ViewTest class. The viewTestMethod method will set * an instance variable to the value passed in on the Event diff --git a/tests/org/puremvc/java/core/ViewTestMediator.java b/src/test/java/org/puremvc/java/core/ViewTestMediator.java similarity index 94% rename from tests/org/puremvc/java/core/ViewTestMediator.java rename to src/test/java/org/puremvc/java/core/ViewTestMediator.java index 66f546a..e7d2651 100644 --- a/tests/org/puremvc/java/core/ViewTestMediator.java +++ b/src/test/java/org/puremvc/java/core/ViewTestMediator.java @@ -13,7 +13,7 @@ /** * A Mediator class used by ViewTest. * - * @see org.puremvc.java.core.ViewTest ViewTest + * @see ViewTest ViewTest */ public class ViewTestMediator extends Mediator implements IMediator { diff --git a/tests/org/puremvc/java/core/ViewTestMediator2.java b/src/test/java/org/puremvc/java/core/ViewTestMediator2.java similarity index 96% rename from tests/org/puremvc/java/core/ViewTestMediator2.java rename to src/test/java/org/puremvc/java/core/ViewTestMediator2.java index 91740c5..5da5add 100644 --- a/tests/org/puremvc/java/core/ViewTestMediator2.java +++ b/src/test/java/org/puremvc/java/core/ViewTestMediator2.java @@ -14,7 +14,7 @@ /** * A Mediator class used by ViewTest. * - * @see org.puremvc.java.core.ViewTest ViewTest + * @see ViewTest ViewTest */ public class ViewTestMediator2 extends Mediator implements IMediator { diff --git a/tests/org/puremvc/java/core/ViewTestMediator3.java b/src/test/java/org/puremvc/java/core/ViewTestMediator3.java similarity index 96% rename from tests/org/puremvc/java/core/ViewTestMediator3.java rename to src/test/java/org/puremvc/java/core/ViewTestMediator3.java index 4f51840..f738e86 100644 --- a/tests/org/puremvc/java/core/ViewTestMediator3.java +++ b/src/test/java/org/puremvc/java/core/ViewTestMediator3.java @@ -14,7 +14,7 @@ /** * A Mediator class used by ViewTest. * - * @see org.puremvc.java.core.ViewTest ViewTest + * @see ViewTest ViewTest */ public class ViewTestMediator3 extends Mediator implements IMediator { diff --git a/tests/org/puremvc/java/core/ViewTestMediator4.java b/src/test/java/org/puremvc/java/core/ViewTestMediator4.java similarity index 95% rename from tests/org/puremvc/java/core/ViewTestMediator4.java rename to src/test/java/org/puremvc/java/core/ViewTestMediator4.java index 454699e..9910ad3 100644 --- a/tests/org/puremvc/java/core/ViewTestMediator4.java +++ b/src/test/java/org/puremvc/java/core/ViewTestMediator4.java @@ -14,7 +14,7 @@ /** * A Mediator class used by ViewTest. * - * @see org.puremvc.java.core.ViewTest ViewTest + * @see ViewTest ViewTest */ public class ViewTestMediator4 extends Mediator implements IMediator { diff --git a/tests/org/puremvc/java/core/ViewTestMediator5.java b/src/test/java/org/puremvc/java/core/ViewTestMediator5.java similarity index 95% rename from tests/org/puremvc/java/core/ViewTestMediator5.java rename to src/test/java/org/puremvc/java/core/ViewTestMediator5.java index 1a13864..5591fd6 100644 --- a/tests/org/puremvc/java/core/ViewTestMediator5.java +++ b/src/test/java/org/puremvc/java/core/ViewTestMediator5.java @@ -14,7 +14,7 @@ /** * A Mediator class used by ViewTest. * - * @see org.puremvc.java.core.ViewTest ViewTest + * @see ViewTest ViewTest */ public class ViewTestMediator5 extends Mediator implements IMediator { diff --git a/tests/org/puremvc/java/core/ViewTestMediator6.java b/src/test/java/org/puremvc/java/core/ViewTestMediator6.java similarity index 95% rename from tests/org/puremvc/java/core/ViewTestMediator6.java rename to src/test/java/org/puremvc/java/core/ViewTestMediator6.java index 0eaf93b..5c00993 100644 --- a/tests/org/puremvc/java/core/ViewTestMediator6.java +++ b/src/test/java/org/puremvc/java/core/ViewTestMediator6.java @@ -13,7 +13,7 @@ /** * A Mediator class used by ViewTest. * - * @see org.puremvc.java.core.ViewTest ViewTest + * @see ViewTest ViewTest */ public class ViewTestMediator6 extends Mediator { diff --git a/tests/org/puremvc/java/core/ViewTestNote.java b/src/test/java/org/puremvc/java/core/ViewTestNote.java similarity index 90% rename from tests/org/puremvc/java/core/ViewTestNote.java rename to src/test/java/org/puremvc/java/core/ViewTestNote.java index 85771f7..68c5b71 100644 --- a/tests/org/puremvc/java/core/ViewTestNote.java +++ b/src/test/java/org/puremvc/java/core/ViewTestNote.java @@ -13,7 +13,7 @@ /** * A Notification class used by ViewTest. * - * @see org.puremvc.java.core.ViewTest ViewTest + * @see ViewTest ViewTest */ public class ViewTestNote extends Notification implements INotification { @@ -35,8 +35,7 @@ public ViewTestNote(String name, Object body) { /** * Factory method. * - *

      - * This method creates new instances of the ViewTestNote class, + *

      This method creates new instances of the ViewTestNote class, * automatically setting the note name so you don't have to. Use * this as an alternative to the constructor.

      * diff --git a/tests/org/puremvc/java/patterns/command/MacroCommandTest.java b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTest.java similarity index 88% rename from tests/org/puremvc/java/patterns/command/MacroCommandTest.java rename to src/test/java/org/puremvc/java/patterns/command/MacroCommandTest.java index 6047291..de65dd0 100644 --- a/tests/org/puremvc/java/patterns/command/MacroCommandTest.java +++ b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTest.java @@ -23,30 +23,26 @@ public class MacroCommandTest { /** * Tests operation of a MacroCommand. * - *

      - * This test creates a new Notification, adding a + *

      This test creates a new Notification, adding a * MacroCommandTestVO as the body. * It then creates a MacroCommandTestCommand and invokes * its execute method, passing in the * Notification.

      * - *

      - * The MacroCommandTestCommand has defined an + *

      The MacroCommandTestCommand has defined an * initializeMacroCommand method, which is * called automatically by its constructor. In this method * the MacroCommandTestCommand adds 2 SubCommands * to itself, MacroCommandTestSub1Command and * MacroCommandTestSub2Command. * - *

      - * The MacroCommandTestVO has 2 result properties, + *

      The MacroCommandTestVO has 2 result properties, * one is set by MacroCommandTestSub1Command by * multiplying the input property by 2, and the other is set * by MacroCommandTestSub2Command by multiplying * the input property by itself. * - *

      - * Success is determined by evaluating the 2 result properties + *

      Success is determined by evaluating the 2 result properties * on the MacroCommandTestVO that was passed to * the MacroCommandTestCommand on the Notification * body.

      diff --git a/tests/org/puremvc/java/patterns/command/MacroCommandTestCommand.java b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTestCommand.java similarity index 83% rename from tests/org/puremvc/java/patterns/command/MacroCommandTestCommand.java rename to src/test/java/org/puremvc/java/patterns/command/MacroCommandTestCommand.java index a5dcdc5..5984ff0 100644 --- a/tests/org/puremvc/java/patterns/command/MacroCommandTestCommand.java +++ b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTestCommand.java @@ -10,10 +10,10 @@ /** * A MacroCommand subclass used by MacroCommandTest. * - * @see org.puremvc.java.patterns.command.MacroCommandTest MacroCommandTest + * @see MacroCommandTest MacroCommandTest * @see org.puremvc.java.patterns.command.MacroCommandTestSub1Command MacroCommandTestSub1Command * @see org.puremvc.java.patterns.command.MacroCommandTestSub2Command MacroCommandTestSub2Command - * @see org.puremvc.java.patterns.command.MacroCommandTestVO MacroCommandTestVO + * @see MacroCommandTestVO MacroCommandTestVO */ public class MacroCommandTestCommand extends MacroCommand { diff --git a/tests/org/puremvc/java/patterns/command/MacroCommandTestSub1Command.java b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTestSub1Command.java similarity index 76% rename from tests/org/puremvc/java/patterns/command/MacroCommandTestSub1Command.java rename to src/test/java/org/puremvc/java/patterns/command/MacroCommandTestSub1Command.java index cb14169..160f782 100644 --- a/tests/org/puremvc/java/patterns/command/MacroCommandTestSub1Command.java +++ b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTestSub1Command.java @@ -12,9 +12,9 @@ /** * A SimpleCommand subclass used by MacroCommandTestCommand. * - * @see org.puremvc.java.patterns.command.MacroCommandTest MacroCommandTest - * @see org.puremvc.java.patterns.command.MacroCommandTestCommand MacroCommandTestCommand - * @see org.puremvc.java.patterns.command.MacroCommandTestVO MacroCommandTestVO + * @see MacroCommandTest MacroCommandTest + * @see MacroCommandTestCommand MacroCommandTestCommand + * @see MacroCommandTestVO MacroCommandTestVO */ public class MacroCommandTestSub1Command extends SimpleCommand { diff --git a/tests/org/puremvc/java/patterns/command/MacroCommandTestSub2Command.java b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTestSub2Command.java similarity index 76% rename from tests/org/puremvc/java/patterns/command/MacroCommandTestSub2Command.java rename to src/test/java/org/puremvc/java/patterns/command/MacroCommandTestSub2Command.java index 8400068..35dbd26 100644 --- a/tests/org/puremvc/java/patterns/command/MacroCommandTestSub2Command.java +++ b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTestSub2Command.java @@ -12,9 +12,9 @@ /** * A SimpleCommand subclass used by MacroCommandTestCommand. * - * @see org.puremvc.java.patterns.command.MacroCommandTest MacroCommandTest - * @see org.puremvc.java.patterns.command.MacroCommandTestCommand MacroCommandTestCommand - * @see org.puremvc.java.patterns.command.MacroCommandTestVO MacroCommandTestVO + * @see MacroCommandTest MacroCommandTest + * @see MacroCommandTestCommand MacroCommandTestCommand + * @see MacroCommandTestVO MacroCommandTestVO */ public class MacroCommandTestSub2Command extends SimpleCommand { diff --git a/tests/org/puremvc/java/patterns/command/MacroCommandTestVO.java b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTestVO.java similarity index 91% rename from tests/org/puremvc/java/patterns/command/MacroCommandTestVO.java rename to src/test/java/org/puremvc/java/patterns/command/MacroCommandTestVO.java index 6f1d93b..9dde234 100644 --- a/tests/org/puremvc/java/patterns/command/MacroCommandTestVO.java +++ b/src/test/java/org/puremvc/java/patterns/command/MacroCommandTestVO.java @@ -10,7 +10,7 @@ /** * A utility class used by MacroCommandTest. * - * @see org.puremvc.java.patterns.command.MacroCommandTest MacroCommandTest + * @see MacroCommandTest MacroCommandTest * @see org.puremvc.java.patterns.command.MacroCommandTestCommand MacroCommandTestCommand * @see org.puremvc.java.patterns.command.MacroCommandTestSub1Command MacroCommandTestSub1Command * @see org.puremvc.java.patterns.command.MacroCommandTestSub2Command MacroCommandTestSub2Command diff --git a/tests/org/puremvc/java/patterns/command/SimpleCommandTest.java b/src/test/java/org/puremvc/java/patterns/command/SimpleCommandTest.java similarity index 91% rename from tests/org/puremvc/java/patterns/command/SimpleCommandTest.java rename to src/test/java/org/puremvc/java/patterns/command/SimpleCommandTest.java index f256fcb..40580d0 100644 --- a/tests/org/puremvc/java/patterns/command/SimpleCommandTest.java +++ b/src/test/java/org/puremvc/java/patterns/command/SimpleCommandTest.java @@ -22,14 +22,12 @@ public class SimpleCommandTest { /** * Tests the execute method of a SimpleCommand. * - *

      - * This test creates a new Notification, adding a + *

      This test creates a new Notification, adding a * SimpleCommandTestVO as the body. * It then creates a SimpleCommandTestCommand and invokes * its execute method, passing in the note.

      * - *

      - * Success is determined by evaluating a property on the + *

      Success is determined by evaluating a property on the * object that was passed on the Notification body, which will * be modified by the SimpleCommand

      . * diff --git a/tests/org/puremvc/java/patterns/command/SimpleCommandTestCommand.java b/src/test/java/org/puremvc/java/patterns/command/SimpleCommandTestCommand.java similarity index 83% rename from tests/org/puremvc/java/patterns/command/SimpleCommandTestCommand.java rename to src/test/java/org/puremvc/java/patterns/command/SimpleCommandTestCommand.java index fce8191..fc706b0 100644 --- a/tests/org/puremvc/java/patterns/command/SimpleCommandTestCommand.java +++ b/src/test/java/org/puremvc/java/patterns/command/SimpleCommandTestCommand.java @@ -12,8 +12,8 @@ /** * A SimpleCommand subclass used by SimpleCommandTest. * - * @see org.puremvc.java.patterns.command.SimpleCommandTest SimpleCommandTest - * @see org.puremvc.java.patterns.command.SimpleCommandTestVO SimpleCommandTestVO + * @see SimpleCommandTest SimpleCommandTest + * @see SimpleCommandTestVO SimpleCommandTestVO */ public class SimpleCommandTestCommand extends SimpleCommand { diff --git a/tests/org/puremvc/java/patterns/command/SimpleCommandTestVO.java b/src/test/java/org/puremvc/java/patterns/command/SimpleCommandTestVO.java similarity index 89% rename from tests/org/puremvc/java/patterns/command/SimpleCommandTestVO.java rename to src/test/java/org/puremvc/java/patterns/command/SimpleCommandTestVO.java index a9dda26..36eb3c0 100644 --- a/tests/org/puremvc/java/patterns/command/SimpleCommandTestVO.java +++ b/src/test/java/org/puremvc/java/patterns/command/SimpleCommandTestVO.java @@ -10,7 +10,7 @@ /** * A utility class used by SimpleCommandTest. * - * @see org.puremvc.java.patterns.command.SimpleCommandTest SimpleCommandTest + * @see SimpleCommandTest SimpleCommandTest * @see org.puremvc.java.patterns.command.SimpleCommandTestCommand SimpleCommandTestCommand */ public class SimpleCommandTestVO { diff --git a/tests/org/puremvc/java/patterns/facade/FacadeTest.java b/src/test/java/org/puremvc/java/patterns/facade/FacadeTest.java similarity index 96% rename from tests/org/puremvc/java/patterns/facade/FacadeTest.java rename to src/test/java/org/puremvc/java/patterns/facade/FacadeTest.java index e71b50d..cd1446a 100644 --- a/tests/org/puremvc/java/patterns/facade/FacadeTest.java +++ b/src/test/java/org/puremvc/java/patterns/facade/FacadeTest.java @@ -39,13 +39,11 @@ public void testGetInstance() { /** * Tests Command registration and execution via the Facade. * - *

      - * This test gets the Singleton Facade instance + *

      This test gets the Singleton Facade instance * and registers the FacadeTestCommand class * to handle 'FacadeTest' Notifcations.

      * - *

      - * It then sends a notification using the Facade. + *

      It then sends a notification using the Facade. * Success is determined by evaluating * a property on an object placed in the body of * the Notification, which will be modified by the Command.

      @@ -71,13 +69,11 @@ public void testRegisterCommandAndSendNotification() { /** * Tests Command removal via the Facade. * - *

      - * This test gets the Singleton Facade instance + *

      This test gets the Singleton Facade instance * and registers the FacadeTestCommand class * to handle 'FacadeTest' Notifcations. Then it removes the command.

      * - *

      - * It then sends a Notification using the Facade. + *

      It then sends a Notification using the Facade. * Success is determined by evaluating * a property on an object placed in the body of * the Notification, which will NOT be modified by the Command.

      @@ -104,8 +100,7 @@ public void testRegisterAndRemoveCommandAndSendNotification() { /** * Tests the regsitering and retrieving Model proxies via the Facade. * - *

      - * Tests registerProxy and retrieveProxy in the same test. + *

      Tests registerProxy and retrieveProxy in the same test. * These methods cannot currently be tested separately * in any meaningful way other than to show that the * methods do not throw exception when called.

      diff --git a/tests/org/puremvc/java/patterns/facade/FacadeTestCommand.java b/src/test/java/org/puremvc/java/patterns/facade/FacadeTestCommand.java similarity index 85% rename from tests/org/puremvc/java/patterns/facade/FacadeTestCommand.java rename to src/test/java/org/puremvc/java/patterns/facade/FacadeTestCommand.java index 7145a8e..6d1de06 100644 --- a/tests/org/puremvc/java/patterns/facade/FacadeTestCommand.java +++ b/src/test/java/org/puremvc/java/patterns/facade/FacadeTestCommand.java @@ -13,8 +13,8 @@ /** * A SimpleCommand subclass used by FacadeTest. * - * @see org.puremvc.java.patterns.facade.FacadeTest FacadeTest - * @see org.puremvc.java.patterns.facade.FacadeTestVO FacadeTestVO + * @see FacadeTest FacadeTest + * @see FacadeTestVO FacadeTestVO */ public class FacadeTestCommand extends SimpleCommand { diff --git a/tests/org/puremvc/java/patterns/facade/FacadeTestVO.java b/src/test/java/org/puremvc/java/patterns/facade/FacadeTestVO.java similarity index 90% rename from tests/org/puremvc/java/patterns/facade/FacadeTestVO.java rename to src/test/java/org/puremvc/java/patterns/facade/FacadeTestVO.java index af678d9..6c88af0 100644 --- a/tests/org/puremvc/java/patterns/facade/FacadeTestVO.java +++ b/src/test/java/org/puremvc/java/patterns/facade/FacadeTestVO.java @@ -10,7 +10,7 @@ /** * A utility class used by FacadeTest. * - * @see org.puremvc.java.patterns.facade.FacadeTest FacadeTest + * @see FacadeTest FacadeTest * @see org.puremvc.java.patterns.facade.FacadeTestCommand FacadeTestCommand */ public class FacadeTestVO { diff --git a/tests/org/puremvc/java/patterns/mediator/MediatorTest.java b/src/test/java/org/puremvc/java/patterns/mediator/MediatorTest.java similarity index 95% rename from tests/org/puremvc/java/patterns/mediator/MediatorTest.java rename to src/test/java/org/puremvc/java/patterns/mediator/MediatorTest.java index 760d3b9..0f84911 100644 --- a/tests/org/puremvc/java/patterns/mediator/MediatorTest.java +++ b/src/test/java/org/puremvc/java/patterns/mediator/MediatorTest.java @@ -14,7 +14,7 @@ * Test the PureMVC Mediator class. * * @see org.puremvc.java.interfaces.IMediator IMediator - * @see org.puremvc.java.patterns.mediator.Mediator Mediator + * @see Mediator Mediator */ public class MediatorTest { diff --git a/tests/org/puremvc/java/patterns/observer/NotificationTest.java b/src/test/java/org/puremvc/java/patterns/observer/NotificationTest.java similarity index 97% rename from tests/org/puremvc/java/patterns/observer/NotificationTest.java rename to src/test/java/org/puremvc/java/patterns/observer/NotificationTest.java index bd67ed3..ad6f2bd 100644 --- a/tests/org/puremvc/java/patterns/observer/NotificationTest.java +++ b/src/test/java/org/puremvc/java/patterns/observer/NotificationTest.java @@ -14,7 +14,7 @@ /** * Test the PureMVC Notification class. * - * @see org.puremvc.java.patterns.observer.Notification Notification + * @see Notification Notification */ public class NotificationTest { diff --git a/tests/org/puremvc/java/patterns/observer/ObserverTest.java b/src/test/java/org/puremvc/java/patterns/observer/ObserverTest.java similarity index 96% rename from tests/org/puremvc/java/patterns/observer/ObserverTest.java rename to src/test/java/org/puremvc/java/patterns/observer/ObserverTest.java index f975887..97d942b 100644 --- a/tests/org/puremvc/java/patterns/observer/ObserverTest.java +++ b/src/test/java/org/puremvc/java/patterns/observer/ObserverTest.java @@ -14,13 +14,11 @@ /** * Tests PureMVC Observer class. * - *

      - * Since the Observer encapsulates the interested object's + *

      Since the Observer encapsulates the interested object's * callback information, there are no getters, only setters. * It is, in effect write-only memory.

      * - *

      - * Therefore, the only way to test it is to set the + *

      Therefore, the only way to test it is to set the * notification method and context and call the notifyObserver * method.

      * @@ -35,7 +33,6 @@ public class ObserverTest { /** * Tests observer class when initialized by accessor methods. - * */ @Test public void testObserverAccessors() { @@ -60,7 +57,6 @@ public void testObserverAccessors() { /** * Tests observer class when initialized by constructor. - * */ @Test public void testObserverConstructor() { @@ -82,7 +78,6 @@ public void testObserverConstructor() { /** * Tests the compareNotifyContext method of the Observer class - * */ @Test public void testCompareNotifyContext() { diff --git a/tests/org/puremvc/java/patterns/proxy/ProxyTest.java b/src/test/java/org/puremvc/java/patterns/proxy/ProxyTest.java similarity index 97% rename from tests/org/puremvc/java/patterns/proxy/ProxyTest.java rename to src/test/java/org/puremvc/java/patterns/proxy/ProxyTest.java index 9869ba2..84e14ba 100644 --- a/tests/org/puremvc/java/patterns/proxy/ProxyTest.java +++ b/src/test/java/org/puremvc/java/patterns/proxy/ProxyTest.java @@ -14,7 +14,7 @@ * Test the PureMVC Proxy class. * * @see org.puremvc.java.interfaces.IProxy IProxy - * @see org.puremvc.java.patterns.proxy.Proxy Proxy + * @see Proxy Proxy */ public class ProxyTest {