Version: 3.5.0

org.generationcp.core.events
Class StateChangeEvent

java.lang.Object
  extended by org.generationcp.core.events.BaseEvent
      extended by org.generationcp.core.events.StateChangeEvent

public class StateChangeEvent
extends BaseEvent

A class representing an event that characterizes a change of state of the underlying process.

Version:
$Id: StateChangeEvent.java 15869 2009-04-18 11:50:39Z msenger $
Author:
Martin Senger

Constructor Summary
StateChangeEvent(java.lang.Object source, java.lang.String message, java.lang.String previousState, java.lang.String newState)
          The most general constructor, taking a message, the two states, the old and new one, and an event source.
StateChangeEvent(java.lang.String previousState, java.lang.String newState)
          A usual constructor, taking just two states, the old and new one.
StateChangeEvent(java.lang.String message, java.lang.String previousState, java.lang.String newState)
          A constructor taking a general message and two states, the old and new one.
 
Method Summary
 java.lang.String getNewState()
          Get the new state as reported by this event.
 java.lang.String getPreviousState()
          Get the previous state as reported by this event.
 org.jdom.Element toXML()
          Create an XML element representing this event.
 
Methods inherited from class org.generationcp.core.events.BaseEvent
formatSource, getMessage, getSource, getTimestamp, isOlderThan, setTimestamp, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StateChangeEvent

public StateChangeEvent(java.lang.Object source,
                        java.lang.String message,
                        java.lang.String previousState,
                        java.lang.String newState)
The most general constructor, taking a message, the two states, the old and new one, and an event source.


StateChangeEvent

public StateChangeEvent(java.lang.String message,
                        java.lang.String previousState,
                        java.lang.String newState)
A constructor taking a general message and two states, the old and new one. The event source is considered unknown.


StateChangeEvent

public StateChangeEvent(java.lang.String previousState,
                        java.lang.String newState)
A usual constructor, taking just two states, the old and new one. There will be no accompanied message, nor the event source.

Method Detail

getPreviousState

public java.lang.String getPreviousState()
Get the previous state as reported by this event.


getNewState

public java.lang.String getNewState()
Get the new state as reported by this event.


toXML

public org.jdom.Element toXML()
Create an XML element representing this event.

Overrides:
toXML in class BaseEvent
Returns:
a jDom element that can be used for building the whole XML document

Version: 3.5.0

Submit a bug or feature
Generated: Fri Jul 23 18:24:48 CDT 2010