net.esper.event
Class WrapperEventBean

java.lang.Object
  extended by net.esper.event.WrapperEventBean
All Implemented Interfaces:
EventBean

public class WrapperEventBean
extends Object
implements EventBean

Event bean that wraps another event bean adding additional properties.

This can be useful for classes for which the statement adds derived values retaining the original class.

The event type of such events is always WrapperEventType. Additional properties are stored in a Map.


Constructor Summary
WrapperEventBean(EventBean event, Map<String,Object> properties, EventType eventType)
          Ctor.
 
Method Summary
 Object get(String property)
          Returns the value of an event property.
 EventType getEventType()
          Return the EventType instance that describes the set of properties available for this event.
 Object getUnderlying()
          Get the underlying data object to this event wrapper.
 EventBean getUnderlyingEvent()
          Returns the wrapped event.
 Map getUnderlyingMap()
          Returns the underlying map storing the additional properties, if any.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrapperEventBean

public WrapperEventBean(EventBean event,
                        Map<String,Object> properties,
                        EventType eventType)
Ctor.

Parameters:
event - is the wrapped event
properties - is zero or more property values that embellish the wrapped event
eventType - is the WrapperEventType.
Method Detail

get

public Object get(String property)
           throws PropertyAccessException
Description copied from interface: EventBean
Returns the value of an event property.

Specified by:
get in interface EventBean
Parameters:
property - - name of the property whose value is to be retrieved
Returns:
the value of a simple property with the specified name.
Throws:
PropertyAccessException - - if there is no property of the specified name, or the property cannot be accessed

getEventType

public EventType getEventType()
Description copied from interface: EventBean
Return the EventType instance that describes the set of properties available for this event.

Specified by:
getEventType in interface EventBean
Returns:
event type

getUnderlying

public Object getUnderlying()
Description copied from interface: EventBean
Get the underlying data object to this event wrapper.

Specified by:
getUnderlying in interface EventBean
Returns:
underlying data object, usually either a Map or a Java bean instance.

getUnderlyingMap

public Map getUnderlyingMap()
Returns the underlying map storing the additional properties, if any.

Returns:
event property map

getUnderlyingEvent

public EventBean getUnderlyingEvent()
Returns the wrapped event.

Returns:
wrapped event

toString

public String toString()
Overrides:
toString in class Object