|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.acsinet_solutions.cetia4.controller.map.AbstractBeanRequestMapper
com.acsinet_solutions.cetia4.controller.map.MultipartBeanRequestMapper
public class MultipartBeanRequestMapper
This class helps to perform mapping between form information and a DTO in a multipart environment. It is similar to BeanRequestMapper with the addition that FileItem properties are recognized and supported. FileItem properties are not mapped using SimpleMapping instances, so beware of this.
| Nested Class Summary | |
|---|---|
class |
MultipartBeanRequestMapper.MultipartDTOMapping
mapping for multipart parameters. |
| Constructor Summary | |
|---|---|
MultipartBeanRequestMapper()
Create a request mapper with no default mappings. |
|
MultipartBeanRequestMapper(java.lang.Class targetClass)
Create a request mapper for the given targetClass using reflection mappings over its simple properties using a nesting level of 3. |
|
MultipartBeanRequestMapper(java.lang.Class targetClass,
int nestingLevel)
Create a request mapper for the given targetClass using reflection mappings over its simple properties at an arbitrary nesting level for nesting properties. |
|
| Method Summary | |
|---|---|
void |
performMapping(java.util.List<org.apache.commons.fileupload.FileItem> items,
java.lang.Object bean)
Perform mapping from a list of file-items, to a bean. |
void |
performMapping(ParameterAccessor request,
java.lang.Object bean)
The parameter accessor must be a multipart context. |
void |
performMapping(javax.servlet.ServletRequest request,
java.lang.Object bean)
Perform the mapping from the HTTP request values to the provided bean in the case of the servlet API. |
protected Mapping |
tryCreateMapping(java.lang.String name,
java.lang.Class type)
Support for FileItem mappings is added. |
| Methods inherited from class com.acsinet_solutions.cetia4.controller.map.AbstractBeanRequestMapper |
|---|
addMapping, getLogger, getMapping, getMappings, getSimpleMapping, getTargetClass, performMapping, removeMapping, setMapping, setValidator, validateAndCheck |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MultipartBeanRequestMapper()
public MultipartBeanRequestMapper(java.lang.Class targetClass)
#BeanRequestMapper(Class,int)
public MultipartBeanRequestMapper(java.lang.Class targetClass,
int nestingLevel)
Additional mappings may be added later, or undesired mappings may be removed if desired.
Default mappings are created using SimpleMapping.getDefaultMapping() method except for FileItem mappings where another class is used. For FileItem mapping, conversion to SimpleMapping in code is thus prohibited.
The name of the mapping will always correspond to the name of the mapped field. For example "text" property will correspond to "text" HTTP field. "note.id" nested property will correspond to "note.id" HTTP field.
targetClass - A not-null Class instance of the JavaBean type that
will be mappedSimpleMapping.getDefaultMapping(String,Class)| Method Detail |
|---|
protected Mapping tryCreateMapping(java.lang.String name,
java.lang.Class type)
tryCreateMapping in class AbstractBeanRequestMapper
public final void performMapping(javax.servlet.ServletRequest request,
java.lang.Object bean)
throws ValidationException
RequestMapperValidation is performed in addition to the mapping, if a validator was set for the current request mapper.
ValidationExceptionRequestMapper.setValidator(Validator)
public final void performMapping(ParameterAccessor request,
java.lang.Object bean)
throws ValidationException
ValidationExceptionRequestMapper.setValidator(Validator)
public final void performMapping(java.util.List<org.apache.commons.fileupload.FileItem> items,
java.lang.Object bean)
throws ValidationException
ValidationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||