com.espertech.esper.event
Class BeanEventBean

java.lang.Object
  extended by com.espertech.esper.event.BeanEventBean
All Implemented Interfaces:
EventBean

public class BeanEventBean
extends Object
implements EventBean

Wrapper for Java bean (POJO or regular) Java objects the represent events. Allows access to event properties, which is done through the getter supplied by the event type. EventType instances containing type information are obtained from BeanEventTypeFactory. Two BeanEventBean instances are equal if they have the same event type and refer to the same instance of event object. Clients that need to compute equality between Java beans wrapped by this class need to obtain the underlying object.


Constructor Summary
BeanEventBean(Object event, EventType eventType)
          Constructor.
 
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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanEventBean

public BeanEventBean(Object event,
                     EventType eventType)
Constructor.

Parameters:
event - is the event object
eventType - is the schema information for the event object.
Method Detail

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.

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

get

public Object get(String property)
           throws IllegalArgumentException,
                  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
IllegalArgumentException

toString

public String toString()
Overrides:
toString in class Object

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com