com.espertech.esper.event.xml
Class BaseXMLEventType

java.lang.Object
  extended by com.espertech.esper.event.BaseConfigurableEventType
      extended by com.espertech.esper.event.xml.BaseXMLEventType
All Implemented Interfaces:
EventType, EventTypeSPI
Direct Known Subclasses:
SchemaXMLEventType, SimpleXMLEventType

public abstract class BaseXMLEventType
extends BaseConfigurableEventType

Base class for XML event types.


Field Summary
protected  XPathNamespaceContext namespaceContext
          XPath namespace context.
 
Fields inherited from class com.espertech.esper.event.BaseConfigurableEventType
propertyDescriptorMap, propertyGetters
 
Constructor Summary
BaseXMLEventType(EventTypeMetadata metadata, int eventTypeId, ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM, EventAdapterService eventAdapterService)
          Ctor.
 
Method Summary
 boolean equals(java.lang.Object otherObj)
          Same-Root XML types are actually equivalent.
 boolean equalsCompareType(EventType eventType)
           
 ConfigurationEventTypeXMLDOM getConfigurationEventTypeXMLDOM()
          Returns the configuration XML for the XML type.
 EventBeanCopyMethod getCopyMethod(java.lang.String[] properties)
          Returns the copy method, considering only the attached properties for a write operation onto the copy
 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.
 java.lang.String getEndTimestampPropertyName()
          Returns the property name of the property providing the end timestamp value.
 EventBeanReader getReader()
          Returns a reader for reading all properties of an event.
 java.lang.String getRootElementName()
          Returns the name of the root element.
 java.lang.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.
 EventPropertyDescriptor getWritableProperty(java.lang.String propertyName)
          Returns the descriptor for a writable property.
 EventPropertyDescriptor[] getWriteableProperties()
          Returns the writable properties.
 EventPropertyWriter getWriter(java.lang.String propertyName)
          Return a writer for writing a single property value.
 EventBeanWriter getWriter(java.lang.String[] properties)
          Returns the write for writing a set of properties.
protected  javax.xml.xpath.XPathFactory getXPathFactory()
          Returns the XPath factory used.
 int hashCode()
           
protected  void initialize(java.util.Collection<ConfigurationEventTypeXMLDOM.XPathPropertyDesc> explicitXPathProperties, java.util.List<ExplicitPropertyDescriptor> additionalSchemaProperties)
          Set the preconfigured event properties resolved by XPath expression.
protected  void setNamespaceContext(XPathNamespaceContext namespaceContext)
          Sets the namespace context for use in XPath expression resolution.
 
Methods inherited from class com.espertech.esper.event.BaseConfigurableEventType
doResolveFragmentType, doResolvePropertyGetter, doResolvePropertyType, getEventAdapterService, getEventTypeId, getFragmentType, getGetter, getGetterIndexed, getGetterMapped, getMetadata, getName, getPropertyDescriptor, getPropertyDescriptors, getPropertyNames, getPropertyType, getUnderlyingType, initialize, isProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaceContext

protected XPathNamespaceContext namespaceContext
XPath namespace context.

Constructor Detail

BaseXMLEventType

public BaseXMLEventType(EventTypeMetadata metadata,
                        int eventTypeId,
                        ConfigurationEventTypeXMLDOM configurationEventTypeXMLDOM,
                        EventAdapterService eventAdapterService)
Ctor.

Parameters:
configurationEventTypeXMLDOM - is the XML DOM configuration such as root element and schema names
metadata - event type metadata
eventAdapterService - for registration and lookup of types
Method Detail

getRootElementName

public java.lang.String getRootElementName()
Returns the name of the root element.

Returns:
root element name

setNamespaceContext

protected void setNamespaceContext(XPathNamespaceContext namespaceContext)
Sets the namespace context for use in XPath expression resolution.

Parameters:
namespaceContext - for XPath expressions

initialize

protected void initialize(java.util.Collection<ConfigurationEventTypeXMLDOM.XPathPropertyDesc> explicitXPathProperties,
                          java.util.List<ExplicitPropertyDescriptor> additionalSchemaProperties)
Set the preconfigured event properties resolved by XPath expression.

Parameters:
explicitXPathProperties - are preconfigured event properties
additionalSchemaProperties - the explicit properties

getXPathFactory

protected javax.xml.xpath.XPathFactory getXPathFactory()
Returns the XPath factory used.

Returns:
XPath factory

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.

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.

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

getConfigurationEventTypeXMLDOM

public ConfigurationEventTypeXMLDOM getConfigurationEventTypeXMLDOM()
Returns the configuration XML for the XML type.

Returns:
config XML

equalsCompareType

public boolean equalsCompareType(EventType eventType)

equals

public boolean equals(java.lang.Object otherObj)
Same-Root XML types are actually equivalent.

Overrides:
equals in class java.lang.Object
Parameters:
otherObj - to compare to
Returns:
indicator

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

getWriter

public EventPropertyWriter getWriter(java.lang.String propertyName)
Description copied from interface: EventTypeSPI
Return a writer for writing a single property value.

Parameters:
propertyName - to write to
Returns:
null or writer if writable

getWriteableProperties

public EventPropertyDescriptor[] getWriteableProperties()
Description copied from interface: EventTypeSPI
Returns the writable properties.

Returns:
properties that can be written

getCopyMethod

public EventBeanCopyMethod getCopyMethod(java.lang.String[] properties)
Description copied from interface: EventTypeSPI
Returns the copy method, considering only the attached properties for a write operation onto the copy

Parameters:
properties - to write after copy
Returns:
copy method

getWritableProperty

public EventPropertyDescriptor getWritableProperty(java.lang.String propertyName)
Description copied from interface: EventTypeSPI
Returns the descriptor for a writable property.

Parameters:
propertyName - to get descriptor for
Returns:
descriptor

getWriter

public EventBeanWriter getWriter(java.lang.String[] properties)
Description copied from interface: EventTypeSPI
Returns the write for writing a set of properties.

Parameters:
properties - to write
Returns:
writer

getReader

public EventBeanReader getReader()
Description copied from interface: EventTypeSPI
Returns a reader for reading all properties of an event. This is completely optional and need only be implemented for performance.

Returns:
reader

getStartTimestampPropertyName

public java.lang.String getStartTimestampPropertyName()
Description copied from interface: EventType
Returns the property name of the property providing the start timestamp value.

Returns:
start timestamp property name

getEndTimestampPropertyName

public java.lang.String getEndTimestampPropertyName()
Description copied from interface: EventType
Returns the property name of the property providing the end timestamp value.

Returns:
end timestamp property name

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com