|
||||||||||
| 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.BeanRequestMapper
public class BeanRequestMapper
This class helps to perform mapping between form information and a DTO. This class is used internally to perform mappings in various parts of the framework as it is very simple to use and highly configurable. It can also be used independently from any framework by instanciating it directly using a bean class as target ( also optional ) and calling any of the performMapping() methods if necessary. Portlet support for this class may also be added if necessary in future versions.
| Constructor Summary | |
|---|---|
BeanRequestMapper()
Create a request mapper with no default mappings. |
|
BeanRequestMapper(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. |
|
BeanRequestMapper(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(ParameterAccessor request,
java.lang.Object bean)
Perform the mapping from the HTTP request values to the provided bean using a generic parameter accesor API. |
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. |
| Methods inherited from class com.acsinet_solutions.cetia4.controller.map.AbstractBeanRequestMapper |
|---|
addMapping, getLogger, getMapping, getMappings, getSimpleMapping, getTargetClass, performMapping, removeMapping, setMapping, setValidator, tryCreateMapping, validateAndCheck |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BeanRequestMapper()
public BeanRequestMapper(java.lang.Class targetClass)
BeanRequestMapper(Class,int)
public BeanRequestMapper(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. All these are instances of SimpleMapping.
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 |
|---|
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
RequestMapperValidation is performed in addition to the mapping, if a validator was set for the current request mapper.
ValidationExceptionRequestMapper.setValidator(Validator)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||