public interface EventType
The interface exposes events as organizations of named values. The contract is that any event in the system must have a name-based way of accessing sub-data within its event type. A simple example is a Java bean: the names can be property names, and those properties can have still more properties beneath them. Another example is a Map structure. Here string names can refer to data objects.
The interface presents an immutable view of events. There are no methods to change property values. Events by definition are an observation of a past occurrance or state change and may not be modified.
Information on the super-types (superclass and interfaces implemented by JavaBean events) is also available, for Java POJO events as well as for Map event types that has supertypes.
Implementations provide metadata on the properties that an implemenation itself provides.
Implementations also allow property expressioms that may use nested, indexed, mapped or a combination of these as a syntax to access property types and values.
Implementations in addition may provide a means to access property values as event fragments, which are typed events themselves.
Modifier and Type | Method and Description |
---|---|
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.
|
String |
getEndTimestampPropertyName()
Returns the property name of the property providing the end timestamp value.
|
int |
getEventTypeId()
Returns the event type id assigned to the event type.
|
FragmentEventType |
getFragmentType(String propertyExpression)
Returns the event type of the fragment that is the value of a property name or property expression.
|
EventPropertyGetter |
getGetter(String propertyExpression)
Get the getter of an event property or property expression: Getters are useful when an application
receives events of the same event type multiple times and requires fast access
to an event property or nested, indexed or mapped property.
|
EventPropertyGetterIndexed |
getGetterIndexed(String indexedPropertyName)
Get the getter of an event property that is a indexed event property: Getters are useful when an application
receives events of the same event type multiple times and requires fast access
to a indexed property.
|
EventPropertyGetterMapped |
getGetterMapped(String mappedPropertyName)
Get the getter of an event property that is a mapped event property: Getters are useful when an application
receives events of the same event type multiple times and requires fast access
to a mapped property.
|
String |
getName()
Returns the type name or null if no type name is assigned.
|
EventPropertyDescriptor |
getPropertyDescriptor(String propertyName)
Get the property descriptor for a given property of the event, or null
if a property by that name was not found.
|
EventPropertyDescriptor[] |
getPropertyDescriptors()
Get property descriptors for the event type.
|
String[] |
getPropertyNames()
Get the property names for the event type.
|
Class |
getPropertyType(String propertyExpression)
Get the type of an event property.
|
String |
getStartTimestampPropertyName()
Returns the property name of the property providing the start timestamp value.
|
EventType[] |
getSuperTypes()
Returns an array of event types that are super to this event type, from which this event type inherited event properties.
|
Class |
getUnderlyingType()
Get the class that represents the Java type of the event type.
|
boolean |
isProperty(String propertyExpression)
Check that the given property name or property expression is valid for this event type, ie.
|
Class getPropertyType(String propertyExpression)
Returns null if the property name or property expression is not valid against the event type. Can also return null if a select-clause selects a constant null value.
The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.
Returns unboxed (such as 'int.class') as well as boxed (java.lang.Integer) type.
propertyExpression
- is the property name or property expressionboolean isProperty(String propertyExpression)
The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.
propertyExpression
- is the property name or property expression to checkEventPropertyGetter getGetter(String propertyExpression)
Returns null if the property name or property expression is not valid against the event type.
The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.
propertyExpression
- is the property name or property expressionFragmentEventType getFragmentType(String propertyExpression)
Returns null if the property name or property expression is not valid or does not return a fragment for the event type.
The EventPropertyDescriptor
provides a flag that indicates which properties
provide fragment events.
This is useful for navigating properties that are itself events or other well-defined types that the underlying event representation may represent as an event type. It is up to each event representation to determine what properties can be represented as event types themselves.
The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.
The underlying event representation may not support providing fragments or therefore fragment event types for any or all properties, in which case the method returns null.
Use the getPropertyDescriptors()
method to obtain a list of properties for which a fragment event type
may be retrieved by this method.
propertyExpression
- is the name of the property to return the fragment event typeClass getUnderlyingType()
String[] getPropertyNames()
Note that properties do not have a defined order. Your application should not rely on the order of properties returned by this method.
The method does not return property names of inner or nested types.
EventPropertyDescriptor[] getPropertyDescriptors()
Note that properties do not have a defined order. Your application should not rely on the order of properties returned by this method.
The method does not return property information of inner or nested types.
EventPropertyDescriptor getPropertyDescriptor(String propertyName)
The property name parameter does accept a property expression. It therefore does not allow the indexed, mapped or nested property expression syntax and only returns the descriptor for the event type's known properties.
The method does not return property information of inner or nested types.
For returning a property descriptor for nested, indexed or mapped properties
use EventTypeUtility
.
propertyName
- property nameEventType[] getSuperTypes()
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.
Iterator<EventType> getDeepSuperTypes()
String getName()
A type name is available for application-configured event types and for event types that represent events of a stream populated by insert-into.
No type name is available for anonymous statement-specific event type.
EventPropertyGetterMapped getGetterMapped(String mappedPropertyName)
Returns null if the property name is not valid against the event type or the property is not a mapped property.
The method takes a mapped property name (and not a property expression) as a parameter.
mappedPropertyName
- is the property nameEventPropertyGetterIndexed getGetterIndexed(String indexedPropertyName)
Returns null if the property name is not valid against the event type or the property is not an indexed property.
The method takes a indexed property name (and not a property expression) as a parameter.
indexedPropertyName
- is the property nameint getEventTypeId()
String getStartTimestampPropertyName()
String getEndTimestampPropertyName()