net.esper.event
Class BaseConfigurableEventType

java.lang.Object
  extended by net.esper.event.BaseConfigurableEventType
All Implemented Interfaces:
EventType
Direct Known Subclasses:
BaseXMLEventType

public abstract class BaseConfigurableEventType
extends java.lang.Object
implements EventType

EventType than can be supplied with a preconfigured list of properties getters (aka. explicit properties).

Author:
pablo

Constructor Summary
protected BaseConfigurableEventType(java.lang.Class underlyngType)
          Ctor.
 
Method Summary
protected abstract  java.lang.String[] doListPropertyNames()
          Subclasses must implement this to supply a list of valid property names.
protected abstract  EventPropertyGetter doResolvePropertyGetter(java.lang.String property)
          Subclasses must implement this and supply a getter to a given property.
protected abstract  java.lang.Class doResolvePropertyType(java.lang.String property)
          Subclasses must implement this and return a type for a property.
 EventPropertyGetter getGetter(java.lang.String property)
          Get the getter for a specified event property.
 java.lang.String[] getPropertyNames()
          Get all valid property names for the event type.
 java.lang.Class getPropertyType(java.lang.String property)
          Get the type of an event property as returned by the "getter" method for that property.
 java.lang.Class getUnderlyingType()
          Get the class that represents the Java type of the event type.
 boolean isProperty(java.lang.String property)
          Check that the given property name is valid for this event type, ie.
protected  void setExplicitProperties(java.util.Map<java.lang.String,TypedEventPropertyGetter> explicitProperties)
          Sets explicit properties using a map of event property name and getter instance for each property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.esper.event.EventType
getDeepSuperTypes, getSuperTypes
 

Constructor Detail

BaseConfigurableEventType

protected BaseConfigurableEventType(java.lang.Class underlyngType)
Ctor.

Parameters:
underlyngType - is the underlying type returned by the event type
Method Detail

setExplicitProperties

protected void setExplicitProperties(java.util.Map<java.lang.String,TypedEventPropertyGetter> explicitProperties)
Sets explicit properties using a map of event property name and getter instance for each property.

Parameters:
explicitProperties - is the preconfigured properties not implicit in the event type

getPropertyType

public java.lang.Class getPropertyType(java.lang.String property)
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:
property - is the property name
Returns:
type of the property, the unboxed or the boxed type.

getUnderlyingType

public 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 property)
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:
property - is the property name
Returns:
a getter that can be used to obtain property values for event instances of the same event type

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.

isProperty

public boolean isProperty(java.lang.String property)
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:
property - is the property to check
Returns:
true if exists, false if not

doListPropertyNames

protected abstract java.lang.String[] doListPropertyNames()
Subclasses must implement this to supply a list of valid property names.

Returns:
list of properties

doResolvePropertyGetter

protected abstract EventPropertyGetter doResolvePropertyGetter(java.lang.String property)
Subclasses must implement this and supply a getter to a given property.

Parameters:
property - is the property name
Returns:
getter for property

doResolvePropertyType

protected abstract java.lang.Class doResolvePropertyType(java.lang.String property)
Subclasses must implement this and return a type for a property.

Parameters:
property - is the property name
Returns:
property type