Spring Web Flow

org.springframework.webflow.action
Class EventFactorySupport

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

public class EventFactorySupport
extends java.lang.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 Summary
EventFactorySupport()
           
 
Method Summary
 Event error(java.lang.Object source)
          Returns an "error" event.
 Event error(java.lang.Object source, java.lang.Exception e)
          Returns an "error" event caused by the provided exception.
 Event event(java.lang.Object source, boolean booleanResult)
          Returns an event to communicate an occurrence of a boolean expression.
 Event event(java.lang.Object source, java.lang.String eventId)
          Returns a event with the specified identifier.
 Event event(java.lang.Object source, java.lang.String eventId, AttributeMap<java.lang.Object> attributes)
          Returns a event with the specified identifier and the specified set of attributes.
 Event event(java.lang.Object source, java.lang.String eventId, java.lang.String attributeName, java.lang.Object attributeValue)
          Returns a result event with the specified identifier and a single attribute.
 java.lang.String getErrorEventId()
           
 java.lang.String getExceptionAttributeName()
           
 java.lang.String getNoEventId()
           
 java.lang.String getNullEventId()
           
 java.lang.String getResultAttributeName()
           
 java.lang.String getSuccessEventId()
           
 java.lang.String getYesEventId()
           
 Event no(java.lang.Object source)
          Returns a "no" result event.
 void setErrorEventId(java.lang.String errorEventId)
           
 void setExceptionAttributeName(java.lang.String exceptionAttributeName)
           
 void setNoEventId(java.lang.String noEventId)
           
 void setNullEventId(java.lang.String nullEventId)
           
 void setResultAttributeName(java.lang.String resultAttributeName)
           
 void setSuccessEventId(java.lang.String successEventId)
           
 void setYesEventId(java.lang.String yesEventId)
           
 Event success(java.lang.Object source)
          Returns a "success" event.
 Event success(java.lang.Object source, java.lang.Object result)
          Returns a "success" event with the provided result object as an attribute.
 Event yes(java.lang.Object source)
          Returns a "yes" event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventFactorySupport

public EventFactorySupport()
Method Detail

getSuccessEventId

public java.lang.String getSuccessEventId()

setSuccessEventId

public void setSuccessEventId(java.lang.String successEventId)

getErrorEventId

public java.lang.String getErrorEventId()

setErrorEventId

public void setErrorEventId(java.lang.String errorEventId)

getYesEventId

public java.lang.String getYesEventId()

setYesEventId

public void setYesEventId(java.lang.String yesEventId)

getNoEventId

public java.lang.String getNoEventId()

setNoEventId

public void setNoEventId(java.lang.String noEventId)

getNullEventId

public java.lang.String getNullEventId()

setNullEventId

public void setNullEventId(java.lang.String nullEventId)

getExceptionAttributeName

public java.lang.String getExceptionAttributeName()

setExceptionAttributeName

public void setExceptionAttributeName(java.lang.String exceptionAttributeName)

getResultAttributeName

public java.lang.String getResultAttributeName()

setResultAttributeName

public void setResultAttributeName(java.lang.String resultAttributeName)

success

public Event success(java.lang.Object source)
Returns a "success" event.

Parameters:
source - the source of the event

success

public Event success(java.lang.Object source,
                     java.lang.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(java.lang.Object source)
Returns an "error" event.

Parameters:
source - the source of the event

error

public Event error(java.lang.Object source,
                   java.lang.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(java.lang.Object source)
Returns a "yes" event.

Parameters:
source - the source of the event

no

public Event no(java.lang.Object source)
Returns a "no" result event.

Parameters:
source - the source of the event

event

public Event event(java.lang.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(java.lang.Object source,
                   java.lang.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(java.lang.Object source,
                   java.lang.String eventId,
                   AttributeMap<java.lang.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(java.lang.Object source,
                   java.lang.String eventId,
                   java.lang.String attributeName,
                   java.lang.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

Spring Web Flow