org.mentawai.coc
Class CoCActionConfig

java.lang.Object
  extended by org.mentawai.core.ActionConfig
      extended by org.mentawai.coc.CoCActionConfig

public class CoCActionConfig
extends ActionConfig

A action config that uses Convention over Configuration. It is not nescessary to configure the which action class will threat each url, neither which consequence will be applied for each result.

The entire classpath will be scanned. All classes that ends with the "Action" sufix will be loaded by the ActionConfig.

For define which consequences will be executed for each result, the CoCActionConfig uses a CoCConsequenceProvider. The CoCConsequenceProvider will provide a consequence based on it's own convention. The default CoCConsequenceProvider implementation is the ForwardCoCConsequenceProvider, but it can be changed by the setConsequenceProvider() method.

Author:
Rubem Azenha (rubem.azenha@gmail.com)

Field Summary
 
Fields inherited from class org.mentawai.core.ActionConfig
actionClass
 
Constructor Summary
CoCActionConfig(String name)
           
 
Method Summary
 Consequence getConsequence(String result)
          Gets the consequence for the given result.
 Consequence getConsequence(String result, String innerAction)
          Gets the consequence for the given result of the given inner action.
static void loadAllActions()
           
static void setConsequenceProvider(ConsequenceProvider consequenceProvider)
           
 
Methods inherited from class org.mentawai.core.ActionConfig
addConsequence, addConsequence, addFilter, addFilter, addFilter, addFilter, addFilter, addFilterFirst, addFilterFirst, addFilterFirst, addFilterFirst, ajaxError, ajaxOk, all, authorize, authorize, bypassAuthentication, catchAll, chainError, chainOk, comeBackAfterLogin, fileUpload, fileUpload, fileUpload, fileUpload, fileUpload, filter, filter, filter, filter, filter, filterFirst, filterFirst, filterFirst, filterFirst, fwdError, fwdOk, getAction, getActionClass, getAutoConsequence, getCatchAll, getDirFromClass, getFilters, getFilters, getFirstFilters, getInnerAction, getName, internalOnly, isInternalOnly, methodParams, on, on, on, prettyURLParams, redirError, redirError, redirError, redirOk, redirOk, redirOk, shouldBypassAuthentication, shouldRedirectAfterLogin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CoCActionConfig

public CoCActionConfig(String name)
Method Detail

loadAllActions

public static void loadAllActions()

getConsequence

public Consequence getConsequence(String result)
Description copied from class: ActionConfig
Gets the consequence for the given result.

Overrides:
getConsequence in class ActionConfig
Parameters:
result - The result for what to get the consequence
Returns:
The consequence associated with the result.

getConsequence

public Consequence getConsequence(String result,
                                  String innerAction)
Description copied from class: ActionConfig
Gets the consequence for the given result of the given inner action.

Overrides:
getConsequence in class ActionConfig
Parameters:
result - The result for what to get the consequence
innerAction - The innerAction from where to get the consequence.
Returns:
The consequence associated with the result and the inner action.

setConsequenceProvider

public static void setConsequenceProvider(ConsequenceProvider consequenceProvider)


Copyright © 2013. All Rights Reserved.