public class RequestSupportImpl extends Object implements RequestSupport
RequestSupport implementation| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.core.convert.ConversionService |
conversionService |
protected static String |
CURRENT |
protected Environment |
environment |
protected ExpressionEvaluator |
expressionEvaluator |
protected FieldConversionFactory |
fieldConverter |
protected List<FieldType> |
FILE_TYPES |
protected List<FieldType> |
LIST_TYPES |
protected org.springframework.context.MessageSource |
messageSource |
| Constructor and Description |
|---|
RequestSupportImpl() |
RequestSupportImpl(org.springframework.core.convert.ConversionService conversionService,
Environment environment,
org.springframework.context.MessageSource messageSource) |
| Modifier and Type | Method and Description |
|---|---|
void |
addErrorMessage(FieldProcessor fp,
MessageParam messageParam)
Adds an error to the
FieldProcessor using FieldProcessor.addErrorMessage(String). |
void |
addErrorMessage(FieldProcessor fp,
MessageParam messageParam,
String fieldBinding)
Adds an error to a
FieldDef using
FieldProcessor.addErrorMessage(org.appng.xml.platform.FieldDef, String). |
void |
afterPropertiesSet() |
boolean |
canConvert(Class<?> sourceType,
Class<?> targetType) |
boolean |
canConvert(org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType) |
<T> T |
convert(Object source,
Class<T> target) |
<T> T |
convert(Object source,
Class<T> target,
T defaultValue) |
Object |
convert(Object source,
org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType) |
void |
fillBindObject(Object instance,
FieldProcessor fp,
RequestContainer container,
ClassLoader classLoader)
Fills the given
bindobject with the (converted) values provided by a RequestContainer. |
Object |
getBindObject(FieldProcessor fp,
RequestContainer container,
ClassLoader classLoader)
Creates, fills and returns a new bindobject.
|
org.springframework.core.convert.ConversionService |
getConversionService() |
<T> T |
getDefaultIfNull(T source,
T defaultValue) |
Environment |
getEnvironment() |
ExpressionEvaluator |
getExpressionEvaluator() |
FieldConverter |
getFieldConverter() |
String |
getMessage(String key,
Object... args)
Retrieves a message from the underlying
MessageSource, using the Locale provided by
Environment.getLocale(). |
org.springframework.context.MessageSource |
getMessageSource() |
void |
handleException(FieldProcessor fp,
Exception e)
Handles an
Exception. |
boolean |
isFile(FieldType type) |
boolean |
isListType(FieldType type) |
void |
setConversionService(org.springframework.core.convert.ConversionService conversionService) |
void |
setEnvironment(Environment environment) |
void |
setExpressionEvaluator(ExpressionEvaluator expressionEvaluator) |
void |
setMessageSource(org.springframework.context.MessageSource messageSource) |
<T> void |
setPropertyValue(T source,
T target,
String property)
Copies the property from
source to target. |
<T> void |
setPropertyValues(T source,
T target,
MetaData metaData)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEnvironment, getFieldConverter, getMessageSourceprotected static final String CURRENT
protected org.springframework.core.convert.ConversionService conversionService
protected org.springframework.context.MessageSource messageSource
protected Environment environment
protected ExpressionEvaluator expressionEvaluator
protected FieldConversionFactory fieldConverter
public RequestSupportImpl()
public RequestSupportImpl(org.springframework.core.convert.ConversionService conversionService,
Environment environment,
org.springframework.context.MessageSource messageSource)
public final void fillBindObject(Object instance, FieldProcessor fp, RequestContainer container, ClassLoader classLoader) throws BusinessException
RequestSupportbindobject with the (converted) values provided by a RequestContainer. The type
of the bindobject must match fp.getMetaData().getBindClass(). The MetaData's
FieldDefinitions are responsible for which fields are getting filled.fillBindObject in interface RequestSupportinstance - the bindobject to fillfp - the current FieldProcessorcontainer - the RequestContainer used to retrieve the values for filling the bindobjectclassLoader - the ClassLoader used to load the bindclassBusinessException - bindobject is not assignable from the type returned by
fp.getMetaData().getBindClass()
fp.getMetaData().getBindClass() can not be
instanciated
public final Object getBindObject(FieldProcessor fp, RequestContainer container, ClassLoader classLoader) throws BusinessException
RequestSupportfp.getMetaData().getBindClass(). The MetaData's FieldDefinitions are responsible for
which fields are getting filled.getBindObject in interface RequestSupportfp - the current FieldProcessorcontainer - the RequestContainer used to retrieve the values for filling the bindobjectclassLoader - the ClassLoader used to load the bindclassBusinessException - if the bindclass could not be loaded, instantiated or initialized, or if an error
occurred during filling the bindobjectRequestSupport.fillBindObject(Object, FieldProcessor, RequestContainer, ClassLoader)public <T> T getDefaultIfNull(T source,
T defaultValue)
public String getMessage(String key, Object... args)
RequestSupportMessageSource, using the Locale provided by
Environment.getLocale().getMessage in interface RequestSupportkey - the message keyargs - the message argumentspublic void addErrorMessage(FieldProcessor fp, MessageParam messageParam)
RequestSupportFieldProcessor using FieldProcessor.addErrorMessage(String).
MessageParam.getMessageKey() is used for the message key, MessageParam.getMessageArgs() for the
message arguments.addErrorMessage in interface RequestSupportfp - a FieldProcessormessageParam - a MessageParamMessageParampublic void addErrorMessage(FieldProcessor fp, MessageParam messageParam, String fieldBinding)
RequestSupportFieldDef using
FieldProcessor.addErrorMessage(org.appng.xml.platform.FieldDef, String).
MessageParam.getMessageKey() is used for the message key, MessageParam.getMessageArgs() for the
message arguments.addErrorMessage in interface RequestSupportfp - a FieldProcessormessageParam - a MessageParamfieldBinding - the binding of the FieldDef to add the error toMessageParampublic void handleException(FieldProcessor fp, Exception e) throws BusinessException
RequestSupportException. If the given Exception is a BusinessException, the very same
BusinessException is being re-thrown. Otherwise, the Exception is being wrapped into a new
BusinessException which is then being thrown.Exception is a MessageParam, RequestSupport.addErrorMessage(FieldProcessor, MessageParam)
is being called.handleException in interface RequestSupportfp - a FieldProcessore - an ExceptionBusinessExceptionMessageParam,
RequestSupport.addErrorMessage(FieldProcessor, MessageParam)public <T> void setPropertyValues(T source,
T target,
MetaData metaData)
RequestSupportsetPropertyValues in interface RequestSupportsource - the source object to read the fields fromtarget - the target object to write the fields tometaData - the MetaDatapublic <T> void setPropertyValue(T source,
T target,
String property)
RequestSupportsource to target.setPropertyValue in interface RequestSupportsource - the source object to read the property fromtarget - the target object to write the property toproperty - the name of the property to setpublic boolean canConvert(Class<?> sourceType, Class<?> targetType)
canConvert in interface org.springframework.core.convert.ConversionServicepublic boolean canConvert(org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType)
canConvert in interface org.springframework.core.convert.ConversionServicepublic Object convert(Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType)
convert in interface org.springframework.core.convert.ConversionServicepublic <T> T convert(Object source, Class<T> target)
convert in interface org.springframework.core.convert.ConversionServicepublic org.springframework.core.convert.ConversionService getConversionService()
public void setConversionService(org.springframework.core.convert.ConversionService conversionService)
public org.springframework.context.MessageSource getMessageSource()
public void setMessageSource(org.springframework.context.MessageSource messageSource)
public Environment getEnvironment()
public void setEnvironment(Environment environment)
public ExpressionEvaluator getExpressionEvaluator()
public void setExpressionEvaluator(ExpressionEvaluator expressionEvaluator)
public final boolean isFile(FieldType type)
public final boolean isListType(FieldType type)
public FieldConverter getFieldConverter()
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanCopyright © 2011–2022 aiticon GmbH. All rights reserved.