com.scooterframework.web.controller
Class ControllerFactory

java.lang.Object
  extended by com.scooterframework.web.controller.ControllerFactory

public class ControllerFactory
extends java.lang.Object

ControllerFactory manages instances of controller classes.


Constructor Summary
ControllerFactory()
           
 
Method Summary
static java.lang.Object createController(java.lang.String controllerClassName, java.lang.String defaultControllerClass)
          Creates a controller instance of the type specified by controllerClassName.
static java.lang.reflect.Method getMethod(java.lang.Class<?> clz, java.lang.String methodName)
          Returns method of an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerFactory

public ControllerFactory()
Method Detail

createController

public static java.lang.Object createController(java.lang.String controllerClassName,
                                                java.lang.String defaultControllerClass)
Creates a controller instance of the type specified by controllerClassName. If it fails to create a controller of type controllerClassName, this method will try to create a controller of type defaultControllerClass when either auto.crud or auto.rest is set to true in properties files.

Parameters:
controllerClassName - controller class name
defaultControllerClass - default controller class name
Returns:
controller instance object

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Class<?> clz,
                                                 java.lang.String methodName)
Returns method of an object.

Parameters:
clz - the class type
methodName - the method name of the object
Returns:
the method object
Throws:
MethodCreationException - if bean or method is null