|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.EventObject
org.springframework.webflow.Event
public class Event
Signals the occurence of something a webflow should respond to. Each event has a string id that provides a key for what happened: e.g "coinInserted", or "pinDropped". An event may optionally contain information about the state in which it occured, e.g "displayVendingMachine" or "waitForUser". Events may have parameters that provide arbitrary payload data, e.g. "coin.amount=25", or "pinDropSpeed=25ms".
For example, a "submit" event might signal that a Submit button was pressed in a web browser. A "success" event might signal an action executed successfully. A "finish" event might signal a sub flow ended normally.
Why is this not an interface? A specific design choice. An event is not a strategy, its essentially a parmaeter object and it is expected that specializations of this base class be "Events" and not part of some other inheritence hierarchy.
| Field Summary |
|---|
| Fields inherited from class java.util.EventObject |
|---|
source |
| Constructor Summary | |
|---|---|
Event(java.lang.Object source)
Constructs a new event with the specified source. |
|
Event(java.lang.Object source,
java.lang.String id)
Create a new event with the specified id. |
|
Event(java.lang.Object source,
java.lang.String id,
java.util.Map parameters)
Create a new event with the specified id and the
provided contextual parameters. |
|
Event(java.lang.Object source,
java.lang.String id,
java.lang.String stateId,
java.util.Map parameters)
Create a new event with the specified id occuring in the
state with the specified stateId and the provided
contextual parameters. |
|
| Method Summary | |
|---|---|
protected void |
addParameters(java.util.Map parameters)
Add given parameters to the set of parameters of this event. |
boolean |
containsAttribute(java.lang.String attributeName)
|
java.lang.Object |
getAttribute(java.lang.String attributeName)
|
java.lang.String |
getId()
Returns the event identifier. |
java.lang.Object |
getParameter(java.lang.String parameterName)
Returns a parameter value given a parameter name, or null
if the parameter was not found. |
java.util.Map |
getParameters()
Returns an unmodifiable parameter map storing parameters associated with this event. |
java.lang.String |
getStateId()
Returns the state in which this event occured (optional). |
long |
getTimestamp()
Returns the time at which the event occured. |
protected void |
setId(java.lang.String id)
Set the event identifier. |
protected void |
setParameters(java.util.Map parameters)
Set the contextual parameters. |
protected void |
setRequiredId(java.lang.String id)
Set the event identifier and make sure it is not null. |
protected void |
setStateId(java.lang.String stateId)
Set the state identifier. |
java.lang.String |
toString()
|
| Methods inherited from class java.util.EventObject |
|---|
getSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Event(java.lang.Object source)
source - the source of the event
public Event(java.lang.Object source,
java.lang.String id)
id.
source - the source of the eventid - the event identifier
public Event(java.lang.Object source,
java.lang.String id,
java.util.Map parameters)
id and the
provided contextual parameters.
source - the source of the eventid - the event identifierparameters - the event parameters
public Event(java.lang.Object source,
java.lang.String id,
java.lang.String stateId,
java.util.Map parameters)
id occuring in the
state with the specified stateId and the provided
contextual parameters.
source - the source of the eventid - the event identifierstateId - the state in which this event occuredparameters - contextual parameters| Method Detail |
|---|
public java.lang.String getId()
null if not
available, e.g. for an event starting a flow.
protected void setRequiredId(java.lang.String id)
id - the event identifierprotected void setId(java.lang.String id)
public long getTimestamp()
public java.lang.String getStateId()
null if not specifiedprotected void setStateId(java.lang.String stateId)
public java.lang.Object getParameter(java.lang.String parameterName)
null
if the parameter was not found.
parameterName - the name of the parameter
null if the parameter is
not present in the eventpublic java.util.Map getParameters()
protected void setParameters(java.util.Map parameters)
protected void addParameters(java.util.Map parameters)
public boolean containsAttribute(java.lang.String attributeName)
containsAttribute in interface org.springframework.binding.AttributeSourcepublic java.lang.Object getAttribute(java.lang.String attributeName)
getAttribute in interface org.springframework.binding.AttributeSourcepublic java.lang.String toString()
toString in class java.util.EventObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||