Class EventFactorySupport

java.lang.Object
org.springframework.webflow.action.EventFactorySupport
Direct Known Subclasses:
ResultObjectBasedEventFactory, SuccessEventFactory

public class EventFactorySupport extends Object
A convenience support class assisting in the creation of Event objects.

This class can be used as a simple utility class when you need to create common event objects. Alternatively you could extend it as a base support class when creating custom event factories.

Author:
Keith Donald, Erwin Vervaet
  • Constructor Details

    • EventFactorySupport

      public EventFactorySupport()
  • Method Details

    • getSuccessEventId

      public String getSuccessEventId()
    • setSuccessEventId

      public void setSuccessEventId(String successEventId)
    • getErrorEventId

      public String getErrorEventId()
    • setErrorEventId

      public void setErrorEventId(String errorEventId)
    • getYesEventId

      public String getYesEventId()
    • setYesEventId

      public void setYesEventId(String yesEventId)
    • getNoEventId

      public String getNoEventId()
    • setNoEventId

      public void setNoEventId(String noEventId)
    • getNullEventId

      public String getNullEventId()
    • setNullEventId

      public void setNullEventId(String nullEventId)
    • getExceptionAttributeName

      public String getExceptionAttributeName()
    • setExceptionAttributeName

      public void setExceptionAttributeName(String exceptionAttributeName)
    • getResultAttributeName

      public String getResultAttributeName()
    • setResultAttributeName

      public void setResultAttributeName(String resultAttributeName)
    • success

      public Event success(Object source)
      Returns a "success" event.
      Parameters:
      source - the source of the event
    • success

      public Event success(Object source, Object result)
      Returns a "success" event with the provided result object as an attribute. The result object is identified by the attribute name getResultAttributeName().
      Parameters:
      source - the source of the event
      result - the action success result
    • error

      public Event error(Object source)
      Returns an "error" event.
      Parameters:
      source - the source of the event
    • error

      public Event error(Object source, Exception e)
      Returns an "error" event caused by the provided exception.
      Parameters:
      source - the source of the event
      e - the exception that caused the error event, to be put as an event attribute under the name getExceptionAttributeName()
    • yes

      public Event yes(Object source)
      Returns a "yes" event.
      Parameters:
      source - the source of the event
    • no

      public Event no(Object source)
      Returns a "no" result event.
      Parameters:
      source - the source of the event
    • event

      public Event event(Object source, boolean booleanResult)
      Returns an event to communicate an occurrence of a boolean expression.
      Parameters:
      source - the source of the event
      booleanResult - the boolean
      Returns:
      yes or no
    • event

      public Event event(Object source, String eventId)
      Returns a event with the specified identifier.
      Parameters:
      source - the source of the event
      eventId - the result event identifier
      Returns:
      the event
    • event

      public Event event(Object source, String eventId, AttributeMap<Object> attributes)
      Returns a event with the specified identifier and the specified set of attributes.
      Parameters:
      source - the source of the event
      eventId - the result event identifier
      attributes - the event payload attributes
      Returns:
      the event
    • event

      public Event event(Object source, String eventId, String attributeName, Object attributeValue)
      Returns a result event with the specified identifier and a single attribute.
      Parameters:
      source - the source of the event
      eventId - the result id
      attributeName - the attribute name
      attributeValue - the attribute value
      Returns:
      the event