org.scopemvc.core
Class ActionManager

java.lang.Object
  |
  +--org.scopemvc.core.ModelManager
        |
        +--org.scopemvc.core.ActionManager
Direct Known Subclasses:
BeansActionManager

public abstract class ActionManager
extends ModelManager

ActionManager is a ModelManager that handles the actions (invokable methods) of model objects. The core of Scope doesn't depend on this manager although this abstract class is in the core package for consistency with the PropertyManager. An implementation for JavaBean model objects is provided in BeansActionManager.

Version:
$Revision: 1.8 $ $Date: 2002/09/06 16:11:45 $
Author:
Steve Meyfroidt

Constructor Summary
ActionManager()
           
 
Method Summary
abstract  boolean canDoAction(java.lang.Object inModel, ModelAction inAction)
          Can this model do the passed ModelAction?
abstract  java.lang.Object doAction(java.lang.Object inModel, ModelAction inAction, java.lang.Object[] inParameters)
          Generic interface to perform arbitrary actions on a model object.
static ActionManager getInstance(java.lang.Class inModelClass)
          Create an ActionManager for the model class
static ActionManager getInstance(java.lang.Object inModel)
          Create an ActionManager for the model
 
Methods inherited from class org.scopemvc.core.ModelManager
getModelClass, make
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionManager

public ActionManager()
Method Detail

getInstance

public static ActionManager getInstance(java.lang.Class inModelClass)
Create an ActionManager for the model class

Parameters:
inModelClass - The class of the model
Returns:
The ActionManager instance

getInstance

public static ActionManager getInstance(java.lang.Object inModel)
Create an ActionManager for the model

Parameters:
inModel - The model
Returns:
The ActionManager instance

doAction

public abstract java.lang.Object doAction(java.lang.Object inModel,
                                          ModelAction inAction,
                                          java.lang.Object[] inParameters)
                                   throws java.lang.Exception
Generic interface to perform arbitrary actions on a model object.

Parameters:
inModel - the model object to perform the action.
inAction - the ModelAction to do.
inParameters - parameters for action.
Returns:
the return from the method (wrapped in an object if primitive type), or null if the method returns void.
Throws:
java.lang.Exception - If the action could not be executed successully

canDoAction

public abstract boolean canDoAction(java.lang.Object inModel,
                                    ModelAction inAction)
Can this model do the passed ModelAction?

Parameters:
inModel - The model that may contain the method for executing the action
inAction - The action
Returns:
True if the model contains the method for executing the action


Copyright © 2000-2002 The Scope Team. All Rights Reserved.