|
||||||||||
| 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
public abstract class AbstractBeanRequestMapper
This is the basic abstract convenience class for performing mapping between form information and a DTO. If provides basic support for subclasses that perform mapping on simple and multipart requests.
| Constructor Summary | |
|---|---|
AbstractBeanRequestMapper()
Create a request mapper with no default mappings. |
|
AbstractBeanRequestMapper(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 |
addMapping(Mapping mapping)
Add a mapping to the mapper. |
protected org.apache.commons.logging.Log |
getLogger()
Get the logger for this instance. |
Mapping |
getMapping(java.lang.String propertyName)
Gets the mapping for a given property. |
java.util.Collection<Mapping> |
getMappings()
Get a reference to a read-only collection with all the mappings. |
SimpleMapping |
getSimpleMapping(java.lang.String propertyName)
Gets the simple mapping for a given property. |
java.lang.Class |
getTargetClass()
Get the class that was mapped with this instance; this method may return null if the mapper was not created with a target class. |
protected void |
performMapping(ParameterAccessor request,
java.lang.Object bean,
ValidationIssueBuilder builder,
Mapping mapping)
Perform a mapping, and check for issues. |
void |
removeMapping(java.lang.String propertyName)
Removes the mapping for a given property. |
void |
setMapping(Mapping mapping)
Sets the mapping for a given property. |
void |
setValidator(Validator validator)
Set an optional validation reference. |
protected Mapping |
tryCreateMapping(java.lang.String name,
java.lang.Class type)
This method tries to create a default mapping for a given class type. |
protected void |
validateAndCheck(ValidationIssueBuilder builder,
java.lang.Object bean)
Perform custom validations, and throw an exception if errors were found. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.acsinet_solutions.cetia4.controller.map.RequestMapper |
|---|
performMapping, performMapping |
| Constructor Detail |
|---|
public AbstractBeanRequestMapper()
public AbstractBeanRequestMapper(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 addMapping(Mapping mapping)
RequestMapper
addMapping in interface RequestMapperpublic final void setMapping(Mapping mapping)
RequestMapper
setMapping in interface RequestMapperMapping.getPropertyName()public final void removeMapping(java.lang.String propertyName)
RequestMapper
removeMapping in interface RequestMapperMapping.getPropertyName()public final Mapping getMapping(java.lang.String propertyName)
RequestMapper
getMapping in interface RequestMapperMapping.getPropertyName()public final SimpleMapping getSimpleMapping(java.lang.String propertyName)
RequestMapper
getSimpleMapping in interface RequestMapperpublic final java.util.Collection<Mapping> getMappings()
RequestMapper
getMappings in interface RequestMapperpublic final void setValidator(Validator validator)
RequestMapper
setValidator in interface RequestMapperValidator.validate(ValidationIssueBuilder,Object)public final java.lang.Class getTargetClass()
protected Mapping tryCreateMapping(java.lang.String name,
java.lang.Class type)
protected void performMapping(ParameterAccessor request,
java.lang.Object bean,
ValidationIssueBuilder builder,
Mapping mapping)
protected final void validateAndCheck(ValidationIssueBuilder builder,
java.lang.Object bean)
throws ValidationException
ValidationExceptionprotected final org.apache.commons.logging.Log getLogger()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||