net.esper.event
Class BeanEventType

java.lang.Object
  extended by net.esper.event.BeanEventType
All Implemented Interfaces:
EventType

public class BeanEventType
extends java.lang.Object
implements EventType

Implementation of the EventType interface for handling JavaBean-type classes.


Constructor Summary
BeanEventType(java.lang.Class clazz, BeanEventAdapter beanEventAdapter)
          Constructor takes a java bean class as an argument.
 
Method Summary
 java.util.Iterator<EventType> getDeepSuperTypes()
          Returns iterator over all super types to event type, going up the hierarchy and including all Java interfaces (and their extended interfaces) and superclasses as EventType instances.
 net.sf.cglib.reflect.FastClass getFastClass()
          Returns the fast class reference, if it exists.
 EventPropertyGetter getGetter(java.lang.String propertyName)
          Get the getter for a specified event property.
 EventPropertyDescriptor getIndexedProperty(java.lang.String propertyName)
          Looks up and returns a cached indexed property's descriptor.
 EventPropertyDescriptor getMappedProperty(java.lang.String propertyName)
          Looks up and returns a cached mapped property's descriptor.
 java.lang.String[] getPropertyNames()
          Get all valid property names for the event type.
 java.lang.Class getPropertyType(java.lang.String propertyName)
          Get the type of an event property as returned by the "getter" method for that property.
 EventPropertyDescriptor getSimpleProperty(java.lang.String propertyName)
          Looks up and returns a cached simple property's descriptor.
protected static void getSuper(java.lang.Class clazz, java.util.Set<java.lang.Class> result)
          Add the given class's implemented interfaces and superclasses to the result set of classes.
 EventType[] getSuperTypes()
          Returns an array of event types that are super to this event type, from which this event type inherited event properties.
 java.lang.Class getUnderlyingType()
          Get the class that represents the Java type of the event type.
 boolean isProperty(java.lang.String propertyName)
          Check that the given property name is valid for this event type, ie.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanEventType

public BeanEventType(java.lang.Class clazz,
                     BeanEventAdapter beanEventAdapter)
Constructor takes a java bean class as an argument.

Parameters:
clazz - is the class of a java bean or other POJO
beanEventAdapter - is the chache and factory for event bean types and event wrappers
Method Detail

getPropertyType

public final java.lang.Class getPropertyType(java.lang.String propertyName)
Description copied from interface: EventType
Get the type of an event property as returned by the "getter" method for that property. Returns unboxed (such as 'int.class') as well as boxed (java.lang.Integer) type. Returns null if the property name is not valid.

Specified by:
getPropertyType in interface EventType
Parameters:
propertyName - is the property name
Returns:
type of the property, the unboxed or the boxed type.

isProperty

public boolean isProperty(java.lang.String propertyName)
Description copied from interface: EventType
Check that the given property name is valid for this event type, ie. that is exists in the event type.

Specified by:
isProperty in interface EventType
Parameters:
propertyName - is the property to check
Returns:
true if exists, false if not

getUnderlyingType

public final java.lang.Class getUnderlyingType()
Description copied from interface: EventType
Get the class that represents the Java type of the event type. Returns a Java bean event class if the schema represents a Java bean event type. Returns java.util.Map is the schema represents a collection of values in a Map.

Specified by:
getUnderlyingType in interface EventType
Returns:
type of the event object

getGetter

public EventPropertyGetter getGetter(java.lang.String propertyName)
Description copied from interface: EventType
Get the getter for a specified event property. Returns null if the property name is not valid.

Specified by:
getGetter in interface EventType
Parameters:
propertyName - is the property name
Returns:
a getter that can be used to obtain property values for event instances of the same event type

getSimpleProperty

public final EventPropertyDescriptor getSimpleProperty(java.lang.String propertyName)
Looks up and returns a cached simple property's descriptor.

Parameters:
propertyName - to look up
Returns:
property descriptor

getMappedProperty

public final EventPropertyDescriptor getMappedProperty(java.lang.String propertyName)
Looks up and returns a cached mapped property's descriptor.

Parameters:
propertyName - to look up
Returns:
property descriptor

getIndexedProperty

public final EventPropertyDescriptor getIndexedProperty(java.lang.String propertyName)
Looks up and returns a cached indexed property's descriptor.

Parameters:
propertyName - to look up
Returns:
property descriptor

getPropertyNames

public java.lang.String[] getPropertyNames()
Description copied from interface: EventType
Get all valid property names for the event type.

Specified by:
getPropertyNames in interface EventType
Returns:
A string array containing the property names of this typed event data object.

getSuperTypes

public EventType[] getSuperTypes()
Description copied from interface: EventType
Returns an array of event types that are super to this event type, from which this event type inherited event properties.

For Java bean instances underlying the event this method returns the event types for all superclasses extended by the Java bean and all interfaces implemented by the Java bean.

Specified by:
getSuperTypes in interface EventType
Returns:
an array of event types

getDeepSuperTypes

public java.util.Iterator<EventType> getDeepSuperTypes()
Description copied from interface: EventType
Returns iterator over all super types to event type, going up the hierarchy and including all Java interfaces (and their extended interfaces) and superclasses as EventType instances.

Specified by:
getDeepSuperTypes in interface EventType
Returns:
iterator of event types represeting all superclasses and implemented interfaces, all the way up to java.lang.Object but excluding java.lang.Object itself

getFastClass

public net.sf.cglib.reflect.FastClass getFastClass()
Returns the fast class reference, if it exists.

Returns:
fast class

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getSuper

protected static void getSuper(java.lang.Class clazz,
                               java.util.Set<java.lang.Class> result)
Add the given class's implemented interfaces and superclasses to the result set of classes.

Parameters:
clazz - to introspect
result - to add classes to