public class ResultObjectBasedEventFactory extends EventFactorySupport implements ResultEventFactory
Result object type | Event id | Remarks |
---|---|---|
null | EventFactorySupport.getNullEventId() |
|
Boolean or boolean |
EventFactorySupport.getYesEventId() /
EventFactorySupport.getNoEventId() |
|
org.springframework.core.enums.LabeledEnum |
org.springframework.core.enums.LabeledEnum#getLabel() |
The result object will included in the event as an attribute named "result". |
Enum |
Enum.name() |
The result object will included in the event as an attribute named "result". |
String |
The string. | |
Event |
The resulting event object. |
Constructor and Description |
---|
ResultObjectBasedEventFactory() |
Modifier and Type | Method and Description |
---|---|
Event |
createResultEvent(java.lang.Object source,
java.lang.Object resultObject,
RequestContext context)
Create an event instance from the result object.
|
boolean |
isMappedValueType(java.lang.Class<?> type)
Check whether or not given type is mapped to a corresponding event using special mapping rules.
|
error, error, event, event, event, event, getErrorEventId, getExceptionAttributeName, getNoEventId, getNullEventId, getResultAttributeName, getSuccessEventId, getYesEventId, no, setErrorEventId, setExceptionAttributeName, setNoEventId, setNullEventId, setResultAttributeName, setSuccessEventId, setYesEventId, success, success, yes
public Event createResultEvent(java.lang.Object source, java.lang.Object resultObject, RequestContext context)
ResultEventFactory
createResultEvent
in interface ResultEventFactory
source
- the source of the eventresultObject
- the result object, typically the return value of a bean methodcontext
- a flow execution request contextpublic boolean isMappedValueType(java.lang.Class<?> type)