Interface ActionFactory


public interface ActionFactory
The actionFactory translates between string based actions, and class based actions.
Author:
marrink
  • Method Details

    • getAction

      WaspAction getAction(String actions)
      Creates or reuses a WaspAction based on string values.
      Parameters:
      actions -
      Returns:
      a WaspAction
    • register

      WaspAction register(Class<? extends WaspAction> waspActionClass, String name) throws RegistrationException
      Register a new action. By default Access, Inherit, Render and Enable are already registered
      Parameters:
      waspActionClass - the class of the action to register (must be subclass of WaspAction
      name - the name to register the action with
      Returns:
      an instance of the registered action
      Throws:
      RegistrationException - if the action cannot be registered
    • getAction

      WaspAction getAction(Class<? extends WaspAction> waspActionClass)
      Returns the registered action of this class.
      Parameters:
      waspActionClass - a subclass of WaspAction
      Returns:
      a new or reused instance of this class
      Throws:
      IllegalArgumentException - if the class is not registered.
    • getRegisteredActions

      List<WaspAction> getRegisteredActions()
      Returns a list of all the registered actions at the time of the invocation. This list is not kept in sync with the factory.
      Returns:
      a list of actions (instances, not classes)
    • destroy

      void destroy()
      Clean up any resources this factory holds.