org.slim3.struts.action
Class S3RequestProcessor

java.lang.Object
  extended by org.apache.struts.action.RequestProcessor
      extended by org.slim3.struts.action.S3RequestProcessor

public class S3RequestProcessor
extends RequestProcessor

RequestProcessor for Slim3.

Since:
3.0
Author:
higa

Nested Class Summary
protected static class S3RequestProcessor.IndexParsedResult
           
 
Field Summary
 
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, log, moduleConfig, servlet
 
Constructor Summary
S3RequestProcessor()
           
 
Method Summary
protected  int[] addArray(int[] array, int value)
          Adds the int value to the array.
protected  Class<?> convertConcreteClass(Class<?> clazz)
          Converts the abstract class to the concrete class.
protected  Object expandArray(Object array, int[] indexes, Class<?> elementClass)
          Expands the array.
protected  void exportProperties(HttpServletRequest request, HttpServletResponse response, BeanDesc beanDesc, boolean redirect)
          Exports action properties to request, session, cookie.
protected  Map<String,Object> getAllParameters(HttpServletRequest request, MultipartRequestHandler multipartHandler)
          Returns all request parameters.
protected  Class<?> getArrayElementClass(Class<?> clazz, int depth)
          Returns the element class of the array.
protected  Object getArrayValue(Object array, int[] indexes, Class<?> elementClass)
          Returns the value of the array.
protected  Object getIndexedProperty(Object bean, String name, int[] indexes)
          Returns the indexed property.
protected  MultipartRequestHandler getMultipartHandler(String multipartClass)
          Returns the multipart request handler.
protected  Object getSimpleProperty(Object bean, String name)
          Returns simple property.
protected  S3RequestProcessor.IndexParsedResult parseIndex(String name)
          Parses the indexed property name.
 void process(HttpServletRequest request, HttpServletResponse response)
           
protected  Action processActionCreate(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
           
protected  ActionForm processActionForm(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
           
protected  void processExecuteConfig(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
          Sets execute configuration.
protected  void processForwardConfig(HttpServletRequest request, HttpServletResponse response, ForwardConfig forward)
          Forward or redirect to the specified destination.
protected  ActionMapping processMapping(HttpServletRequest request, HttpServletResponse response, String path)
           
protected  HttpServletRequest processMultipart(HttpServletRequest request)
           
protected  void processPopulate(HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping)
           
protected  boolean processRoles(HttpServletRequest request, HttpServletResponse response, ActionMapping mapping)
           
protected  void setArrayValue(Object array, int[] indexes, Object value)
          Sets the value of the array.
protected  void setIndexedProperty(Object bean, String name, int[] indexes, Object value)
          Sets indexed property.
protected  void setProperty(Object bean, String name, Object value)
          Sets request parameter to the property of the action.
protected  void setSimpleProperty(Object bean, String name, Object value)
          Sets simple property.
 
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doForward, doInclude, getInternal, getServletContext, init, internalModuleRelativeForward, internalModuleRelativeInclude, log, log, processActionPerform, processCachedMessages, processContent, processException, processForward, processInclude, processLocale, processNoCache, processPath, processPreprocess, processValidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

S3RequestProcessor

public S3RequestProcessor()
Method Detail

process

public void process(HttpServletRequest request,
                    HttpServletResponse response)
             throws IOException,
                    ServletException
Overrides:
process in class RequestProcessor
Throws:
IOException
ServletException

processMultipart

protected HttpServletRequest processMultipart(HttpServletRequest request)
Overrides:
processMultipart in class RequestProcessor

processMapping

protected ActionMapping processMapping(HttpServletRequest request,
                                       HttpServletResponse response,
                                       String path)
                                throws IOException
Overrides:
processMapping in class RequestProcessor
Throws:
IOException

processExecuteConfig

protected void processExecuteConfig(HttpServletRequest request,
                                    HttpServletResponse response,
                                    ActionMapping mapping)
                             throws IllegalStateException
Sets execute configuration.

Parameters:
request - the request
response - the response
mapping - the action mapping
Throws:
IllegalStateException - if execute method is not specified

processRoles

protected boolean processRoles(HttpServletRequest request,
                               HttpServletResponse response,
                               ActionMapping mapping)
                        throws IOException,
                               ServletException
Overrides:
processRoles in class RequestProcessor
Throws:
IOException
ServletException

processActionForm

protected ActionForm processActionForm(HttpServletRequest request,
                                       HttpServletResponse response,
                                       ActionMapping mapping)
Overrides:
processActionForm in class RequestProcessor

processActionCreate

protected Action processActionCreate(HttpServletRequest request,
                                     HttpServletResponse response,
                                     ActionMapping mapping)
                              throws IOException
Overrides:
processActionCreate in class RequestProcessor
Throws:
IOException

processPopulate

protected void processPopulate(HttpServletRequest request,
                               HttpServletResponse response,
                               ActionForm form,
                               ActionMapping mapping)
                        throws ServletException
Overrides:
processPopulate in class RequestProcessor
Throws:
ServletException

getMultipartHandler

protected MultipartRequestHandler getMultipartHandler(String multipartClass)
                                               throws ServletException
Returns the multipart request handler.

Parameters:
multipartClass - the name of multipart request handler
Returns:
the multipart request handler
Throws:
ServletException - if an exception is encountered.

getAllParameters

protected Map<String,Object> getAllParameters(HttpServletRequest request,
                                              MultipartRequestHandler multipartHandler)
Returns all request parameters.

Parameters:
request - the request
multipartHandler - the multipart request handler
Returns:
all request parameters

processForwardConfig

protected void processForwardConfig(HttpServletRequest request,
                                    HttpServletResponse response,
                                    ForwardConfig forward)
                             throws IOException,
                                    ServletException
Forward or redirect to the specified destination.

Overrides:
processForwardConfig in class RequestProcessor
Parameters:
request - the request
response - the response
forward - the forward configuration
Throws:
IOException - if IOException error occurs
ServletException - if ServletException occurs

exportProperties

protected void exportProperties(HttpServletRequest request,
                                HttpServletResponse response,
                                BeanDesc beanDesc,
                                boolean redirect)
Exports action properties to request, session, cookie.

Parameters:
request - the request
response - the response
beanDesc - the bean descriptor
redirect - redirect flag

setProperty

protected void setProperty(Object bean,
                           String name,
                           Object value)
Sets request parameter to the property of the action.

Parameters:
bean - the bean
name - the parameter name
value - the parameter value

getSimpleProperty

protected Object getSimpleProperty(Object bean,
                                   String name)
Returns simple property.

Parameters:
bean - the bean
name - the property name
Returns:
the property value

setSimpleProperty

protected void setSimpleProperty(Object bean,
                                 String name,
                                 Object value)
Sets simple property.

Parameters:
bean - the bean
name - the parameter name
value - the parameter value

getIndexedProperty

protected Object getIndexedProperty(Object bean,
                                    String name,
                                    int[] indexes)
Returns the indexed property.

Parameters:
bean - the bean
name - the property name
indexes - The array of indexes
Returns:
the value

setIndexedProperty

protected void setIndexedProperty(Object bean,
                                  String name,
                                  int[] indexes,
                                  Object value)
Sets indexed property.

Parameters:
bean - the bean
name - the property name
indexes - the array of indexes
value - the value

getArrayElementClass

protected Class<?> getArrayElementClass(Class<?> clazz,
                                        int depth)
Returns the element class of the array.

Parameters:
clazz - the class of the array
depth - the array depth
Returns:
the element class of the array

expandArray

protected Object expandArray(Object array,
                             int[] indexes,
                             Class<?> elementClass)
Expands the array.

Parameters:
array - the array
indexes - the array of indexes
elementClass - the element class of the array
Returns:
expanded array

addArray

protected int[] addArray(int[] array,
                         int value)
Adds the int value to the array.

Parameters:
array - the array
value - the int value
Returns:
added array.

getArrayValue

protected Object getArrayValue(Object array,
                               int[] indexes,
                               Class<?> elementClass)
Returns the value of the array.

Parameters:
array - the array
indexes - the array of indexes
elementClass - the element class of the array
Returns:
the value of the array

setArrayValue

protected void setArrayValue(Object array,
                             int[] indexes,
                             Object value)
Sets the value of the array.

Parameters:
array - the array
indexes - the array of indexes
value - the value of the array

convertConcreteClass

protected Class<?> convertConcreteClass(Class<?> clazz)
Converts the abstract class to the concrete class.

Parameters:
clazz - the class
Returns:
converted class

parseIndex

protected S3RequestProcessor.IndexParsedResult parseIndex(String name)
Parses the indexed property name.

Parameters:
name - the property name
Returns:
the parsed result.


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.