org.deckfour.xes.extension.std
Class XExtendedEvent

java.lang.Object
  extended by org.deckfour.xes.extension.std.XExtendedEvent
All Implemented Interfaces:
Cloneable, XAttributable, XElement, XEvent

public class XExtendedEvent
extends Object
implements XEvent

Helper class. This class can be used to dynamically wrap any event, and provides an extended set of getter and setter methods for typically-available extension attributes.

Author:
Christian W. Guenther (christian@deckfour.org)

Field Summary
protected  XEvent original
          The original, wrapped event.
 
Constructor Summary
XExtendedEvent(XEvent original)
          Constructs a new wrapper object.
 
Method Summary
 Object clone()
          Creates an identical copy of this element.
 XAttributeMap getAttributes()
          Retrieves the attributes set for this element.
 Set<XExtension> getExtensions()
          Retrieves the extensions used by this element, i.e.
 String getGroup()
          Returns the group of the event, as defined by the Organizational extension.
 String getInstance()
          Retrieves the activity instance of this event, as defined by the Concept extension.
 List<String> getModelReferences()
          Returns the list of model references defined for this event, as defined in the Semantic extension.
 List<URI> getModelReferenceURIs()
          Returns the list of model reference URIs defined for this event, as defined in the Semantic extension.
 String getName()
          Retrieves the activity name of this event, as defined by the Concept extension.
 String getResource()
          Returns the resource of the event, as defined by the Organizational extension.
 String getRole()
          Returns the role of the event, as defined by the Organizational extension.
 XLifecycleExtension.StandardModel getStandardTransition()
          Returns the standard lifecycle transition of the event, as defined by the Lifecycle extension.
 Date getTimestamp()
          Retrieves the timestamp of the event, as defined by the Time extension.
 String getTransition()
          Returns the lifecycle transition of the event, as defined by the Lifecycle extension.
 void setAttributes(XAttributeMap attributes)
          Sets the map of attributes for this element.
 void setGroup(String group)
          Sets the group of the event, as defined by the Organizational extension.
 void setInstance(String instance)
          Sets the activity instance of this event, as defined by the Concept extension.
 void setModelReferences(List<String> modelReferences)
          Sets the list of model reference strings defined for this event, as defined in the Semantic extension.
 void setModelReferenceURIs(List<URI> modelReferenceURIs)
          Sets the list of model reference URIs defined for this event, as defined in the Semantic extension.
 void setName(String name)
          Sets the activity name of this event, as defined by the Concept extension.
 void setResource(String resource)
          Sets the resource of the event, as defined by the Organizational extension.
 void setRole(String role)
          Sets the role of the event, as defined by the Organizational extension.
 void setStandardTransition(XLifecycleExtension.StandardModel transition)
          Sets the standard lifecycle transition of the event, as defined by the Lifecycle extension.
 void setTimestamp(Date timestamp)
          Sets the timestamp of the event, as defined by the Time extension.
 void setTimestamp(long timestamp)
          Sets the timestamp of the event, as defined by the Time extension.
 void setTransition(String transition)
          Sets the lifecycle transition of the event, as defined by the Lifecycle extension.
static XExtendedEvent wrap(XEvent event)
          Static wrapper method.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

original

protected XEvent original
The original, wrapped event.

Constructor Detail

XExtendedEvent

public XExtendedEvent(XEvent original)
Constructs a new wrapper object.

Parameters:
original - The original event to be wrapped.
Method Detail

wrap

public static XExtendedEvent wrap(XEvent event)
Static wrapper method. Wraps the given event into an instance of this class, which transparently provides extended access to attributes.

Parameters:
event - The original event to be wrapped.
Returns:
A wrapped event.

getName

public String getName()
Retrieves the activity name of this event, as defined by the Concept extension.

Returns:
Activity name of the event.

setName

public void setName(String name)
Sets the activity name of this event, as defined by the Concept extension.

Parameters:
name - Activity name of the event.

getInstance

public String getInstance()
Retrieves the activity instance of this event, as defined by the Concept extension.

Returns:
Activity instance of the event.

setInstance

public void setInstance(String instance)
Sets the activity instance of this event, as defined by the Concept extension.

Parameters:
instance - Activity instance of the event.

getTimestamp

public Date getTimestamp()
Retrieves the timestamp of the event, as defined by the Time extension.

Returns:
Timestamp as Date object, or null if not defined.

setTimestamp

public void setTimestamp(Date timestamp)
Sets the timestamp of the event, as defined by the Time extension.

Parameters:
timestamp - Timestamp, as Date, to be set.

setTimestamp

public void setTimestamp(long timestamp)
Sets the timestamp of the event, as defined by the Time extension.

Parameters:
timestamp - Timestamp, as long value in milliseconds, to be set.

getResource

public String getResource()
Returns the resource of the event, as defined by the Organizational extension.

Returns:
Resource string. Can be null, if not defined.

setResource

public void setResource(String resource)
Sets the resource of the event, as defined by the Organizational extension.

Parameters:
resource - Resource string.

getRole

public String getRole()
Returns the role of the event, as defined by the Organizational extension.

Returns:
Role string. Can be null, if not defined.

setRole

public void setRole(String role)
Sets the role of the event, as defined by the Organizational extension.

Parameters:
role - Role string.

getGroup

public String getGroup()
Returns the group of the event, as defined by the Organizational extension.

Returns:
Group string. Can be null, if not defined.

setGroup

public void setGroup(String group)
Sets the group of the event, as defined by the Organizational extension.

Parameters:
group - Group string.

getTransition

public String getTransition()
Returns the lifecycle transition of the event, as defined by the Lifecycle extension.

Returns:
Lifecycle transition string. Can be null, if not defined.

setTransition

public void setTransition(String transition)
Sets the lifecycle transition of the event, as defined by the Lifecycle extension.

Parameters:
transition - Lifecycle transition string.

getStandardTransition

public XLifecycleExtension.StandardModel getStandardTransition()
Returns the standard lifecycle transition of the event, as defined by the Lifecycle extension.

Returns:
Standard lifecycle transition object. Can be null, if not defined.

setStandardTransition

public void setStandardTransition(XLifecycleExtension.StandardModel transition)
Sets the standard lifecycle transition of the event, as defined by the Lifecycle extension.

Parameters:
transition - Standard lifecycle transition object.

getModelReferences

public List<String> getModelReferences()
Returns the list of model references defined for this event, as defined in the Semantic extension.

Returns:
List of model reference strings.

setModelReferences

public void setModelReferences(List<String> modelReferences)
Sets the list of model reference strings defined for this event, as defined in the Semantic extension.

Parameters:
modelReferences - List of model reference strings.

getModelReferenceURIs

public List<URI> getModelReferenceURIs()
Returns the list of model reference URIs defined for this event, as defined in the Semantic extension.

Returns:
List of model reference URIs.

setModelReferenceURIs

public void setModelReferenceURIs(List<URI> modelReferenceURIs)
Sets the list of model reference URIs defined for this event, as defined in the Semantic extension.

Parameters:
modelReferenceURIs - List of model reference URIs.

getAttributes

public XAttributeMap getAttributes()
Description copied from interface: XAttributable
Retrieves the attributes set for this element.

Specified by:
getAttributes in interface XAttributable
Returns:
A map of attributes.

getExtensions

public Set<XExtension> getExtensions()
Description copied from interface: XAttributable
Retrieves the extensions used by this element, i.e. the extensions used by all attributes of this element, and the element itself.

Specified by:
getExtensions in interface XAttributable
Returns:
A set of extensions.

setAttributes

public void setAttributes(XAttributeMap attributes)
Description copied from interface: XAttributable
Sets the map of attributes for this element.

Specified by:
setAttributes in interface XAttributable
Parameters:
attributes - A map of attributes.

clone

public Object clone()
Description copied from interface: XElement
Creates an identical copy of this element.

Specified by:
clone in interface XElement
Overrides:
clone in class Object
Returns:
An identical clone.