public abstract class BaseConfigurableEventType extends Object implements EventTypeSPI
Modifier and Type | Field and Description |
---|---|
protected Map<String,EventPropertyDescriptor> |
propertyDescriptorMap
Descriptors for each known property.
|
protected Map<String,EventPropertyGetterSPI> |
propertyGetters
Getters for each known property.
|
EPTYPE, EPTYPEARRAY
Modifier | Constructor and Description |
---|---|
protected |
BaseConfigurableEventType(EventBeanTypedEventFactory eventBeanTypedEventFactory,
EventTypeMetadata metadata,
EPTypeClass underlyingType,
EventTypeNameResolver eventTypeResolver,
XMLFragmentEventTypeFactory xmlEventTypeFactory) |
Modifier and Type | Method and Description |
---|---|
protected abstract FragmentEventType |
doResolveFragmentType(String property)
Subclasses must implement this and return a fragment type for a property.
|
protected abstract EventPropertyGetterSPI |
doResolvePropertyGetter(String property)
Subclasses must implement this and supply a getter to a given property.
|
protected abstract EPType |
doResolvePropertyType(String property)
Subclasses must implement this and return a type for a property.
|
EventBeanTypedEventFactory |
getEventBeanTypedEventFactory()
Returns the event adapter service.
|
EventTypeNameResolver |
getEventTypeResolver() |
FragmentEventType |
getFragmentType(String property)
Returns the event type of the fragment that is the value of a property name or property expression.
|
EventPropertyGetter |
getGetter(String propertyName)
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.
|
EventPropertyGetterIndexedSPI |
getGetterIndexed(String indexedProperty)
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.
|
EventPropertyGetterIndexedSPI |
getGetterIndexedSPI(String propertyName) |
EventPropertyGetterMapped |
getGetterMapped(String mappedProperty)
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.
|
EventPropertyGetterMappedSPI |
getGetterMappedSPI(String mappedProperty) |
EventPropertyGetterSPI |
getGetterSPI(String propertyExpression) |
EventTypeMetadata |
getMetadata()
Returns the type metadata.
|
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.
|
EPType |
getPropertyEPType(String propertyExpression)
Get the type of an event property with type parameters and null-type indication.
|
String[] |
getPropertyNames()
Get the property names for the event type.
|
Class |
getPropertyType(String propertyName)
Get the type of an event property.
|
EPTypeClass |
getUnderlyingEPType()
Get the full type information, including type parameters, that represents the Java type of the event type.
|
Class |
getUnderlyingType()
Get the class that represents the Java type of the event type.
|
XMLFragmentEventTypeFactory |
getXmlEventTypeFactory() |
protected void |
initialize(List<ExplicitPropertyDescriptor> explicitProperties)
Sets explicit properties using a map of event property name and getter instance for each property.
|
boolean |
isProperty(String property)
Check that the given property name or property expression is valid for this event type, ie.
|
void |
setMetadataId(long publicId,
long protectedId) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
equalsCompareType, getCopyMethodForge, getWritableProperty, getWriteableProperties, getWriter, getWriter
getDeepSuperTypes, getDeepSuperTypesAsSet, getEndTimestampPropertyName, getStartTimestampPropertyName, getSuperTypes
protected Map<String,EventPropertyGetterSPI> propertyGetters
protected Map<String,EventPropertyDescriptor> propertyDescriptorMap
protected BaseConfigurableEventType(EventBeanTypedEventFactory eventBeanTypedEventFactory, EventTypeMetadata metadata, EPTypeClass underlyingType, EventTypeNameResolver eventTypeResolver, XMLFragmentEventTypeFactory xmlEventTypeFactory)
protected abstract EventPropertyGetterSPI doResolvePropertyGetter(String property)
property
- is the property expressionprotected abstract EPType doResolvePropertyType(String property)
property
- is the property expressionprotected abstract FragmentEventType doResolveFragmentType(String property)
property
- is the property expressionpublic String getName()
EventType
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.
public EventBeanTypedEventFactory getEventBeanTypedEventFactory()
public EventTypeNameResolver getEventTypeResolver()
public XMLFragmentEventTypeFactory getXmlEventTypeFactory()
public void setMetadataId(long publicId, long protectedId)
setMetadataId
in interface EventTypeSPI
protected void initialize(List<ExplicitPropertyDescriptor> explicitProperties)
explicitProperties
- property descriptors for explicit propertiespublic final Class getPropertyType(String propertyName)
EventType
Returns null if the property name or property expression is not valid against the event type. Can also return null for null-value type i.e. 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.
Use EventType.getPropertyEPType(String)
instead for type parameters.
The implementation uses EventType.getPropertyEPType(String)
under the hoods.
getPropertyType
in interface EventType
propertyName
- is the property name or property expressionpublic EPType getPropertyEPType(String propertyExpression)
EventType
Returns null if the property name or property expression is not valid against the event type.
Returns EPTypeNull
for null-value 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.
Returns unboxed (such as 'int.class') as well as boxed (java.lang.Integer) type.
getPropertyEPType
in interface EventType
propertyExpression
- is the property name or property expressionpublic Class getUnderlyingType()
EventType
EventType.getUnderlyingEPType()
to receive the parameterized type.getUnderlyingType
in interface EventType
public EPTypeClass getUnderlyingEPType()
EventType
getUnderlyingEPType
in interface EventType
public EventPropertyGetterSPI getGetterSPI(String propertyExpression)
getGetterSPI
in interface EventTypeSPI
public EventPropertyGetter getGetter(String propertyName)
EventType
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.
public EventPropertyGetterMapped getGetterMapped(String mappedProperty)
EventType
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.
getGetterMapped
in interface EventType
mappedProperty
- is the property namepublic EventPropertyGetterMappedSPI getGetterMappedSPI(String mappedProperty)
getGetterMappedSPI
in interface EventTypeSPI
public EventPropertyGetterIndexedSPI getGetterIndexedSPI(String propertyName)
getGetterIndexedSPI
in interface EventTypeSPI
public EventPropertyGetterIndexedSPI getGetterIndexed(String indexedProperty)
EventType
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.
getGetterIndexed
in interface EventType
indexedProperty
- is the property namepublic FragmentEventType getFragmentType(String property)
EventType
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 EventType.getPropertyDescriptors()
method to obtain a list of properties for which a fragment event type
may be retrieved by this method.
getFragmentType
in interface EventType
property
- is the name of the property to return the fragment event typepublic String[] getPropertyNames()
EventType
Note that the order of property names depends on the underlying event type.
The method does not return property names of inner or nested types.
getPropertyNames
in interface EventType
public boolean isProperty(String property)
EventType
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.
isProperty
in interface EventType
property
- is the property name or property expression to checkpublic EventPropertyDescriptor[] getPropertyDescriptors()
EventType
Note that the order of property names depends on the underlying event type.
The method does not return property information of inner or nested types.
getPropertyDescriptors
in interface EventType
public EventTypeMetadata getMetadata()
EventType
getMetadata
in interface EventType
public EventPropertyDescriptor getPropertyDescriptor(String propertyName)
EventType
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
.
getPropertyDescriptor
in interface EventType
propertyName
- property nameCopyright © 2005–2022. All rights reserved.