Class ResultObjectBasedEventFactory

java.lang.Object
org.springframework.webflow.action.EventFactorySupport
org.springframework.webflow.action.ResultObjectBasedEventFactory
All Implemented Interfaces:
ResultEventFactory

public class ResultObjectBasedEventFactory extends EventFactorySupport implements ResultEventFactory
Result object-to-event adapter interface that tries to do a sensible conversion of the result object into a web flow event. It uses the following:
Conversion Table
Result object type Event id Remarks
null EventFactorySupport.getNullEventId()  
Boolean or boolean EventFactorySupport.getYesEventId()/ EventFactorySupport.getNoEventId()  
Enum Enum.name() The result object will included in the event as an attribute named "result".
String The string.  
Event The resulting event object.  
Author:
Keith Donald, Erwin Vervaet
  • Constructor Details

    • ResultObjectBasedEventFactory

      public ResultObjectBasedEventFactory()
  • Method Details

    • createResultEvent

      public Event createResultEvent(Object source, Object resultObject, RequestContext context)
      Description copied from interface: ResultEventFactory
      Create an event instance from the result object.
      Specified by:
      createResultEvent in interface ResultEventFactory
      Parameters:
      source - the source of the event
      resultObject - the result object, typically the return value of a bean method
      context - a flow execution request context
      Returns:
      the event
    • isMappedValueType

      public boolean isMappedValueType(Class<?> type)
      Check whether or not given type is mapped to a corresponding event using special mapping rules.