public interface RequestSupport
extends org.springframework.core.convert.ConversionService
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 |
fillBindObject(Object bindobject,
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.
|
Environment |
getEnvironment()
Returns the
Environment for this Request . |
FieldConverter |
getFieldConverter()
Returns a
FieldConverter |
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()
Returns the currently used
MessageSource |
void |
handleException(FieldProcessor fp,
Exception e)
Handles an
Exception . |
<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)
|
FieldConverter getFieldConverter()
FieldConverter
FieldConverter
void handleException(FieldProcessor fp, Exception e) throws BusinessException
Exception
. 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
, addErrorMessage(FieldProcessor, MessageParam)
is being called.fp
- a FieldProcessor
e
- an Exception
BusinessException
MessageParam
,
addErrorMessage(FieldProcessor, MessageParam)
void addErrorMessage(FieldProcessor fp, MessageParam messageParam)
FieldProcessor
using FieldProcessor.addErrorMessage(String)
.
MessageParam.getMessageKey()
is used for the message key, MessageParam.getMessageArgs()
for the
message arguments.fp
- a FieldProcessor
messageParam
- a MessageParam
MessageParam
void addErrorMessage(FieldProcessor fp, MessageParam messageParam, String fieldBinding)
FieldDef
using
FieldProcessor.addErrorMessage(org.appng.xml.platform.FieldDef, String)
.
MessageParam.getMessageKey()
is used for the message key, MessageParam.getMessageArgs()
for the
message arguments.fp
- a FieldProcessor
messageParam
- a MessageParam
fieldBinding
- the binding of the FieldDef
to add the error toMessageParam
<T> void setPropertyValues(T source, T target, MetaData metaData)
source
- the source object to read the fields fromtarget
- the target object to write the fields tometaData
- the MetaData
IllegalArgumentException
- if the type of T
is incompatible to MetaData.getBindClass()
or the bindclass can not
be found.<T> void setPropertyValue(T source, T target, String property)
source
to target
.source
- the source object to read the property fromtarget
- the target object to write the property toproperty
- the name of the property to setObject getBindObject(FieldProcessor fp, RequestContainer container, ClassLoader classLoader) throws BusinessException
fp.getMetaData().getBindClass()
. The MetaData
's FieldDef
initions are responsible for
which fields are getting filled.fp
- the current FieldProcessor
container
- 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 bindobjectfillBindObject(Object, FieldProcessor, RequestContainer, ClassLoader)
void fillBindObject(Object bindobject, FieldProcessor fp, RequestContainer container, ClassLoader classLoader) throws BusinessException
bindobject
with the (converted) values provided by a RequestContainer
. The type
of the bindobject
must match fp.getMetaData().getBindClass()
. The MetaData
's
FieldDef
initions are responsible for which fields are getting filled.bindobject
- the bindobject to fillfp
- the current FieldProcessor
container
- 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
org.springframework.context.MessageSource getMessageSource()
MessageSource
MessageSource
String getMessage(String key, Object... args)
MessageSource
, using the Locale
provided by
Environment.getLocale()
.key
- the message keyargs
- the message argumentsEnvironment getEnvironment()
Environment
for this Request
.Environment
Copyright © 2011–2020 aiticon GmbH. All rights reserved.