- Revision
- 548
- Author
- mward
- Date
- 2008-01-14 07:49:27 -0600 (Mon, 14 Jan 2008)
Log Message
javadoc: added docs for rest of action package
Modified Paths
- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodExecutor.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodResponse.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodResponseHandler.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ArgumentResolver.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/MethodDefinition.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/MethodNameResolver.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ParanamerMethodDefinitionFinder.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/RequestParameterMethodNameResolver.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/ControllerDefinition.java
- trunk/waffle.ipr
Diff
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodExecutor.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodExecutor.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodExecutor.java 2008-01-14 13:49:27 UTC (rev 548) @@ -19,5 +19,13 @@ */ public interface ActionMethodExecutor { - void execute(ActionMethodResponse actionMethodResponse, ControllerDefinition controllerDefinition) throws ActionMethodInvocationException; + /** + * Invoke the action method + * + * @param actionMethodResponse the response from the action methods invocation + * @param controllerDefinition the current controller definition + * @throws ActionMethodInvocationException + */ + void execute(ActionMethodResponse actionMethodResponse, + ControllerDefinition controllerDefinition) throws ActionMethodInvocationException; }
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodResponse.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodResponse.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodResponse.java 2008-01-14 13:49:27 UTC (rev 548) @@ -28,10 +28,10 @@ @Override public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("[ActionMethodResponse returnValue="); - sb.append(returnValue); - sb.append("]"); - return sb.toString(); + return new StringBuilder() + .append("[ActionMethodResponse returnValue=") + .append(returnValue) + .append("]") + .toString(); } }
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodResponseHandler.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodResponseHandler.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ActionMethodResponseHandler.java 2008-01-14 13:49:27 UTC (rev 548) @@ -16,18 +16,20 @@ import java.io.IOException; /** + * <p>Custom implementation of this interface will be able to act in response to the values returned from an + * ActionMethod. + * * @author Michael Ward */ public interface ActionMethodResponseHandler { /** - * Custom implementation of this interface will be able to act in response to the values returned from an - * ActionMethod. Regardless of the implementation an ActionMethodResponse value of null should return to the referring - * page. + * Handles response from an action method invocation. Regardless of the implementation an ActionMethodResponse + * value of [EMAIL PROTECTED] null} indicates that the user should be return to the referring page. * * @param request * @param response - * @param actionMethodResponse - a value of null should return to the refering page + * @param actionMethodResponse * @throws java.io.IOException * @throws javax.servlet.ServletException */
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ArgumentResolver.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ArgumentResolver.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ArgumentResolver.java 2008-01-14 13:49:27 UTC (rev 548) @@ -12,7 +12,18 @@ import javax.servlet.http.HttpServletRequest; +/** + * Implementation of this interface are responsible for resolving an action methods argument value by name. The means + * by which argument resolution is handled is to the discretion of the implementation + */ public interface ArgumentResolver { + /** + * Find the associated value for the argument name + * + * @param request is the current request + * @param name the name of the argument being resolved + * @return the arguments resolved value, or [EMAIL PROTECTED] null} if not resolved + */ Object resolve(HttpServletRequest request, String name); }
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/MethodDefinition.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/MethodDefinition.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/MethodDefinition.java 2008-01-14 13:49:27 UTC (rev 548) @@ -27,26 +27,33 @@ this.method = method; } + /** + * The method that is to be invoked on the controller + */ public Method getMethod() { return method; } + /** + * The argument values that will be used to satisfy the invocation of the action method + */ public List<Object> getMethodArguments() { return arguments; } + /** + * Allows resolved argument to be added. Arguments should be added in order. + */ public void addMethodArgument(Object argument) { arguments.add(argument); } @Override public String toString() { - StringBuffer sb = new StringBuffer(); - sb.append("[MethodDefinition method="); - sb.append(method); - sb.append(", arguments="); - sb.append(arguments); - sb.append("]"); + StringBuilder sb = new StringBuilder("[MethodDefinition method=") + .append(method) + .append(", arguments=") + .append(arguments).append("]"); return sb.toString(); } }
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/MethodNameResolver.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/MethodNameResolver.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/MethodNameResolver.java 2008-01-14 13:49:27 UTC (rev 548) @@ -12,7 +12,16 @@ import javax.servlet.http.HttpServletRequest; +/** + * Implementation of this interface will be able to determine the action method name that is to be invoked. + */ public interface MethodNameResolver { + /** + * Find the method name to be invoked + * + * @param request is the current request + * @return the name of the method that is to be invoked + */ String resolve(HttpServletRequest request); }
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ParanamerMethodDefinitionFinder.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ParanamerMethodDefinitionFinder.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/ParanamerMethodDefinitionFinder.java 2008-01-14 13:49:27 UTC (rev 548) @@ -26,7 +26,7 @@ /** * <p>Pananamer-based method definition finder, which can be used in alternative to - * other definition finders, eg [EMAIL PROTECTED] AnnotatedMethodDefinitionFinder}.<p> + * other definition finders, eg [EMAIL PROTECTED] AnnotatedMethodDefinitionFinder}.</p> * <br/><br/> * <b>Note</b>: Pragmatic method calls will always take precedence. *
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/action/RequestParameterMethodNameResolver.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/action/RequestParameterMethodNameResolver.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/action/RequestParameterMethodNameResolver.java 2008-01-14 13:49:27 UTC (rev 548) @@ -10,14 +10,14 @@ *****************************************************************************/ package org.codehaus.waffle.action; +import org.codehaus.waffle.monitor.ActionMonitor; + import javax.servlet.http.HttpServletRequest; -import org.codehaus.waffle.monitor.ActionMonitor; - /** - * Implementation of method name resolver which returns the value of a configurable action parameter key, + * <p>Implementation of method name resolver which returns the value of a configurable action parameter key, * which defaults to 'method'. - * <p/> + * </p><br/> * The resolved name is monitored along with the available parameter key set. * * @author Michael Ward @@ -36,6 +36,13 @@ this.actionMonitor = actionMonitor; } + /** + * This implementation determines the method name from the request parameters (the default parameter name + * used is <code><b>method</b></code>). + * + * @param request + * @return + */ @SuppressWarnings({"unchecked"}) public String resolve(HttpServletRequest request) { String methodName = request.getParameter(methodParameterKey);
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/ControllerDefinition.java (547 => 548)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/ControllerDefinition.java 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/ControllerDefinition.java 2008-01-14 13:49:27 UTC (rev 548) @@ -13,13 +13,14 @@ import org.codehaus.waffle.action.MethodDefinition; /** - * In Waffle a Controller can be any Pojo. Controllers are registered per application + * <p>In Waffle a Controller can be any Pojo. Controllers are registered per application * with a custom <code>Registrar</code>. This class is, a wrapper to merge both * the name the controller was registered under and the actual controller instance. * <br/> * <b>NOTE:</b> This is required so that Waffle can properly direct to a * view when no 'controller method' request parameter was found, which typically occurs * when a user first enters a web application. + * </p> * * @author Michael Ward */ @@ -34,14 +35,24 @@ this.methodDefinition = methodDefinition; } + /** + * The name the controller is registered under in Waffle. + */ public String getName() { return name; } + /** + * The controller (Pojo) this definition is wrapping + */ public Object getController() { return controller; } + /** + * The method definition which defines tha method and argument values to be invoked + * on the controller + */ public MethodDefinition getMethodDefinition() { return methodDefinition; }
Modified: trunk/waffle.ipr (547 => 548)
--- trunk/waffle.ipr 2008-01-12 02:11:07 UTC (rev 547) +++ trunk/waffle.ipr 2008-01-14 13:49:27 UTC (rev 548) @@ -406,5 +406,8 @@ <component name="com.intellij.profile.ui.ErrorOptionsConfigurable" proportions="" version="1"> <option name="myLastEditedConfigurable" /> </component> + <UsedPathMacros> + <macro name="M2_REPOSITORY" /> + </UsedPathMacros> </project>
To unsubscribe from this list please visit:
