org.scopemvc.model.beans
Class BeansActionManager

java.lang.Object
  |
  +--org.scopemvc.core.ModelManager
        |
        +--org.scopemvc.core.ActionManager
              |
              +--org.scopemvc.model.beans.BeansActionManager

public class BeansActionManager
extends ActionManager

BeansActionManager is a ActionManager that handles the actions (invokable methods) of JavaBean model objects.

Version:
$Revision: 1.8 $ $Date: 2002/09/12 10:51:03 $
Author:
Steve Meyfroidt

Constructor Summary
BeansActionManager()
           
 
Method Summary
 boolean canDoAction(java.lang.Object inModel, ModelAction inAction)
          Returns true if the ModelAction can be executed on the model object.
 java.lang.Object doAction(java.lang.Object inModel, ModelAction inAction, java.lang.Object[] inParameters)
          Execute the ModelAction with the given parameters
protected  java.lang.reflect.Method getMethod(java.lang.Object inModel, ModelAction inAction)
          Find a Method matching the prototype in the passed ModelAction for the passed model object, using the BeanInfo to introspect the model as a JavaBean.
protected static boolean matchesItem(java.lang.Class inPrototypeClass, java.lang.Class inParameterClass)
          Utility method to determine if a given class matches another class, taking into account primitive<->class mapping and inheritance.
protected static boolean matchesPrototype(java.lang.Class[] inPrototypeClasses, java.lang.Class[] inParameterClasses)
          Utility method to determine if a given parameter class array matches the supplied prototype class array
 
Methods inherited from class org.scopemvc.core.ActionManager
getInstance, getInstance
 
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

BeansActionManager

public BeansActionManager()
Method Detail

matchesPrototype

protected static boolean matchesPrototype(java.lang.Class[] inPrototypeClasses,
                                          java.lang.Class[] inParameterClasses)
Utility method to determine if a given parameter class array matches the supplied prototype class array

Parameters:
inPrototypeClasses - the prototype that is used in the comparison
inParameterClasses - these are the parameter classes that must be validated against the prototype
Returns:
whether the parameter classes match the prototype

matchesItem

protected static boolean matchesItem(java.lang.Class inPrototypeClass,
                                     java.lang.Class inParameterClass)
Utility method to determine if a given class matches another class, taking into account primitive<->class mapping and inheritance.

Parameters:
inPrototypeClass - TODO: Describe the Parameter
inParameterClass - TODO: Describe the Parameter
Returns:
TODO: Describe the Return Value

doAction

public java.lang.Object doAction(java.lang.Object inModel,
                                 ModelAction inAction,
                                 java.lang.Object[] inParameters)
                          throws java.lang.Exception
Execute the ModelAction with the given parameters

Specified by:
doAction in class ActionManager
Parameters:
inModel - The model used for executing the ModelAction
inAction - The action (method) to execute
inParameters - The parameters of the method
Returns:
The result of the ModelAction method
Throws:
java.lang.Exception - if the execution of the ModelAction failed for any reason

canDoAction

public boolean canDoAction(java.lang.Object inModel,
                           ModelAction inAction)
Returns true if the ModelAction can be executed on the model object.
If the model implements DynamicInvokable, then check that the ModelAction can be invoked by calling the isActionInvokable() method on the model.

Specified by:
canDoAction in class ActionManager
Parameters:
inModel - The model used for executing the ModelAction
inAction - The action (method) to execute
Returns:
true if the ModelAction can be executed on the model

getMethod

protected java.lang.reflect.Method getMethod(java.lang.Object inModel,
                                             ModelAction inAction)
Find a Method matching the prototype in the passed ModelAction for the passed model object, using the BeanInfo to introspect the model as a JavaBean.

Parameters:
inAction - find a Method that matches the prototype described in this ModelAction.
inModel - The model used for executing the ModelAction
Returns:
a Method matching the ModelAction for the passed model or null if no match.


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