Commits

Anonymous committed 7122b35
  • Participants
  • Parent commits 6012423

Comments (0)

Files changed (10)

src/java/com/opensymphony/webwork/interceptor/ApplicationAware.java

 
 
 /**
- *        Actions that want to be aware of the application Map object
- * should implement this interface. This will give them access
- * to a Map where they can put objects that should be available
- * to other parts of the application.
+ * Actions that want to be aware of the application Map object should implement this interface.
+ * This will give them access to a Map where they can put objects that should be available
+ * to other parts of the application. <p>
  *
  * Typical uses are configuration objects and caches.
  *
- *        @author Rickard Öberg (rickard@middleware-company.com)
- *        @version $Revision$
+ * @author <a href="mailto:rickard@middleware-company.com">Rickard Öberg</a>
  */
 public interface ApplicationAware {
-    //~ Methods ////////////////////////////////////////////////////////////////
 
+    /**
+     * Sets the map of application properties in the implementing class.
+     *
+     * @param application a Map of application properties.
+     */
     public void setApplication(Map application);
 }

src/java/com/opensymphony/webwork/interceptor/NoParameters.java

 
 
 /**
- * This marker interface should be implemented by actions that do not want any
- * parameters set on them automatically (by the ParametersActionFactoryProxy)
- * This may be useful if one is using the action tag and want to supply
- * the parameters to the action manually using the param tag.
- * It may also be useful if one for security reasons wants to make sure that
- * parameters cannot be set by malicious users.
+ * This marker interface should be implemented by actions that do not want any parameters set on
+ * them automatically. This may be useful if one is using the action tag and want to supply
+ * the parameters to the action manually using the param tag. It may also be useful if one for
+ * security reasons wants to make sure that parameters cannot be set by malicious users.
  *
- * @author        Dick Zetterberg (dick@transitor.se)
- * @version        $Revision$, $Date$
+ * @author <a href="mailto:dick@transitor.se">Dick Zetterberg</a>
  */
 public interface NoParameters extends com.opensymphony.xwork.interceptor.NoParameters {
 }

src/java/com/opensymphony/webwork/interceptor/ParameterAware.java

 
 
 /**
- *        This interface gives actions an alternative way of receiving
- * input parameters. The map will contain all input parameters as
- * name/value entries. Actions that need this should simply implement it.
+ * This interface gives actions an alternative way of receiving input parameters. The map will
+ * contain all input parameters as name/value entries. Actions that need this should simply implement it. <p>
  *
- * One common use for this is to have the action propagate parameters
- * to internally instantiated data objects.
+ * One common use for this is to have the action propagate parameters to internally instantiated data
+ * objects. <p>
  *
- * Note that all parameter values for a given name will be returned,
- * so the type of the objects in the map is java.lang.String[]
+ * Note that all parameter values for a given name will be returned, so the type of the objects in
+ * the map is <tt>java.lang.String[]</tt>.
  *
- *        @author Rickard Öberg (rickard@middleware-company.com)
- *        @version $Revision$
+ * @author <a href="mailto:rickard@middleware-company.com">Rickard Öberg</a>
  */
 public interface ParameterAware {
-    //~ Methods ////////////////////////////////////////////////////////////////
 
+    /**
+     * Sets the  map of input parameters in the implementing class.
+     *
+     * @param parameters a Map of parameters (name/value Strings).
+     */
     public void setParameters(Map parameters);
 }

src/java/com/opensymphony/webwork/interceptor/ServletConfigInterceptor.java

 
 
 /**
+ * An interceptor which sets action properties based on the interfaces an action implements.
+ * For example, if the action implements {@link ParameterAware} then the action
+ * context's parameter map will be set on it. <p>
  *
+ * This interceptor is designed to set all properties an action needs if it's aware of servlet
+ * parametes, the servlet context, the session, etc.
  *
- * @author $Author$
- * @version $Revision$
+ * @author Patrick Lightbody
+ * @author Bill Lynch (docs)
  */
 public class ServletConfigInterceptor extends AroundInterceptor implements WebWorkStatics {
-    //~ Methods ////////////////////////////////////////////////////////////////
 
+    /**
+     * Does nothing.
+     */
     protected void after(ActionInvocation dispatcher, String result) throws Exception {
     }
 
+    /**
+     * Sets action properties based on the interfaces an action implements. Things like
+     * application properties, parameters, session attributes, etc are set based on
+     * the implementing interface.
+     *
+     * @param invocation an encapsulation of the action execution state.
+     * @throws Exception if an error occurs when setting action properties.
+     */
     protected void before(ActionInvocation invocation) throws Exception {
         Action action = invocation.getAction();
         ActionContext context = ActionContext.getContext();

src/java/com/opensymphony/webwork/interceptor/ServletRequestAware.java

 
 
 /**
- * All Actions that want to have access to the servlet request
- * objects must implement this interface.
+ * All Actions that want to have access to the servlet request object must implement this interface.<p>
  *
- * This interface is only relevant if the Action is used in a servlet
- * environment.
+ * This interface is only relevant if the Action is used in a servlet environment. <p>
  *
- * Note that using this interface makes the Action tied to a servlet
- * environment, so it should be avoided if possible.
+ * Note that using this interface makes the Action tied to a servlet environment, so it should be
+ * avoided if possible since things like unit testing will become more difficult.
  *
- *        @author Rickard Öberg (rickard@middleware-company.com)
- *        @version $Revision$
+ * @author <a href="mailto:rickard@middleware-company.com">Rickard Öberg</a>
  */
 public interface ServletRequestAware {
-    //~ Methods ////////////////////////////////////////////////////////////////
 
+    /**
+     * Sets the HTTP request object in implementing classes.
+     *
+     * @param request the HTTP request.
+     */
     public void setServletRequest(HttpServletRequest request);
 }

src/java/com/opensymphony/webwork/interceptor/ServletResponseAware.java

 
 
 /**
- * All Actions that want to have access to the servlet response
- * objects must implement this interface.
+ * All Actions that want to have access to the servlet response object must implement this interface.<p>
  *
- * This interface is only relevant if the Action is used in a servlet
- * environment.
+ * This interface is only relevant if the Action is used in a servlet environment.<p>
  *
- * Note that using this interface makes the Action tied to a servlet
- * environment, so it should be avoided if possible.
+ * Note that using this interface makes the Action tied to a servlet environment, so it should be
+ * avoided if possible since things like unit testing will become more difficult.
  *
- *        @author Rickard Öberg (rickard@middleware-company.com)
- *        @version $Revision$
+ * @author <a href="mailto:rickard@middleware-company.com">Rickard Öberg</a>
  */
 public interface ServletResponseAware {
-    //~ Methods ////////////////////////////////////////////////////////////////
 
+    /**
+     * Sets the HTTP response object in implementing classes.
+     *
+     * @param response the HTTP response.
+     */
     public void setServletResponse(HttpServletResponse response);
 }

src/java/com/opensymphony/webwork/interceptor/SessionAware.java

 
 
 /**
- *        Actions that want access to the users session should implement this interface.
+ * Actions that want access to the user's HTTP session should implement this interface.<p>
  *
- *        @author Rickard Öberg (rickard@middleware-company.com)
- *        @version $Revision$
+ * This interface is only relevant if the Action is used in a servlet environment.<p>
+ *
+ * Note that using this interface makes the Action tied to a servlet environment, so it should be
+ * avoided if possible since things like unit testing will become more difficult.
+ *
+ * @author <a href="mailto:rickard@middleware-company.com">Rickard Öberg</a>
  */
 public interface SessionAware {
-    //~ Methods ////////////////////////////////////////////////////////////////
 
+    /**
+     * Sets the Map of session attributes in the implementing class.
+     *
+     * @param session a Map of HTTP session attribute name/value pairs.
+     */
     public void setSession(Map session);
 }

src/java/com/opensymphony/webwork/interceptor/TokenInterceptor.java

 
 
 /**
- * TokenInterceptor
+ *
+ *
  * @author Jason Carreira
- * Created Apr 2, 2003 11:27:57 PM
  */
 public class TokenInterceptor implements Interceptor {
-    //~ Static fields/initializers /////////////////////////////////////////////
 
     public static final String INVALID_TOKEN_CODE = "invalid.token";
     private static final Log LOG = LogFactory.getLog(TokenInterceptor.class);
 
-    //~ Methods ////////////////////////////////////////////////////////////////
-
     /**
-     * Called to let an interceptor clean up any resources it has allocated.
+     * Called to let an interceptor clean up any resources it has allocated. Does nothing by default -
+     * subclass and overwrite to customize.
      */
     public void destroy() {
     }
 
     /**
-     * Called after an Interceptor is created, but before any requests are processed using the intercept() methodName. This
-     * gives the Interceptor a chance to initialize any needed resources.
+     * Called after an Interceptor is created, but before any requests are processed using the
+     * {@link #intercept(ActionInvocation)} method.. This gives the Interceptor a chance to
+     * initialize any needed resources. Currently does nothing - subclass and overwrite to customize.
      */
     public void init() {
     }
 
     /**
-     * Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the
-     * request by the DefaultActionInvocation or to short-circuit the processing and just return a String return code.
      *
-     * @param invocation
+     *
+     * @param invocation an encapsulation of the action execution state.
      * @throws Exception
      */
     public String intercept(ActionInvocation invocation) throws Exception {
     }
 
     /**
-     * Handles the case of an invalid token
+     *
+     * 
      * @param invocation
+     * @return
+     * @throws Exception
      */
     protected String handleInvalidToken(ActionInvocation invocation) throws Exception {
         Action action = invocation.getAction();
     }
 
     /**
-     * Handle the case of a valid token
+     *
+     *
      * @param invocation
      * @throws Exception
      */

src/java/com/opensymphony/webwork/interceptor/TokenSessionStoreInterceptor.java

 
 
 /**
- * TokenSessionStoreInterceptor
+ *
+ *
  * @author Jason Carreira
- * Created Apr 14, 2003 10:33:19 PM
  */
 public class TokenSessionStoreInterceptor extends TokenInterceptor {
-    //~ Methods ////////////////////////////////////////////////////////////////
 
     /**
-     * Handles the case of an invalid token
+     *
+     *
      * @param invocation
+     * @return
+     * @throws Exception
      */
     protected String handleInvalidToken(ActionInvocation invocation) throws Exception {
         HttpServletRequest request = ServletActionContext.getRequest();
     }
 
     /**
-     * Handle the case of a valid token
+     *
+     *
      * @param invocation
+     * @return
      * @throws Exception
-     */
+     */ 
     protected String handleValidToken(ActionInvocation invocation) throws Exception {
         // we know the token name and token must be there
         HttpServletRequest request = ServletActionContext.getRequest();

src/java/com/opensymphony/webwork/interceptor/WebWorkConversionErrorInterceptor.java

 
 
 /**
- * WebWorkConversionErrorInterceptor adds the conversion errors from the ActionContext to the field errors of the Action
- * if the field value is not null, "", or {""} (A size 1 String array with only an empty String).
+ * This interceptor adds the conversion errors from the ActionContext to the field errors of the Action
+ * if the field value is not null, "", or {""} (a size 1 String array with only an empty String).
  *
  * @see com.opensymphony.xwork.ActionContext#getConversionErrors()
  * @see ConversionErrorInterceptor
  * @author Jason Carreira
- * Date: Nov 27, 2003 4:17:24 PM
  */
 public class WebWorkConversionErrorInterceptor extends ConversionErrorInterceptor {
-    //~ Methods ////////////////////////////////////////////////////////////////
 
+    /**
+     * Returns <tt>false</tt> if the value is null, "", or {""} (array of size 1 with
+     * a blank element). Returns <tt>true</tt> otherwise.
+     *
+     * @param propertyName the name of the property to check.
+     * @param value the value to error check.
+     * @return <tt>false</tt>  if the value is null, "", or {""}, <tt>true</tt> otherwise.
+     */
     protected boolean shouldAddError(String propertyName, Object value) {
         if (value == null) {
             return false;