net.esper.client
Class ConfigurationEventTypeXMLDOM

java.lang.Object
  extended by net.esper.client.ConfigurationEventTypeXMLDOM

public class ConfigurationEventTypeXMLDOM
extends Object

Configuration object for enabling the engine to process events represented as XML DOM document nodes.

Use this class to configure the engine for processing of XML DOM objects that represent events and contain all the data for event properties used by statements.

Minimally required is the root element name which allows the engine to map the document to the event type that has been named in an EQL or pattern statement.

Event properties that are results of XPath expressions can be made known to the engine via this class. For XPath expressions that must refer to namespace prefixes those prefixes and their namespace name must be supplied to the engine. A default namespace can be supplied as well.

By supplying a schema resource the engine can interrogate the schema, allowing the engine to verify event properties and return event properties in the type defined by the schema. When a schema resource is supplied, the optional root element namespace defines the namespace in case the root element name occurs in multiple namespaces.


Nested Class Summary
static class ConfigurationEventTypeXMLDOM.XPathPropertyDesc
          Descriptor class for event properties that are resolved via XPath-expression.
 
Constructor Summary
ConfigurationEventTypeXMLDOM()
          Ctor.
 
Method Summary
 void addNamespacePrefix(String prefix, String namespace)
          Add a prefix and namespace name for use in XPath expressions refering to that prefix.
 void addXPathProperty(String name, String xpath, QName type)
          Adds an event property for which the engine uses the supplied XPath expression against a DOM document node to resolve a property value.
 boolean equals(Object otherObj)
           
 String getDefaultNamespace()
          Returns the default namespace.
 Map<String,String> getNamespacePrefixes()
          Returns the namespace prefixes in a map of prefix as key and namespace name as value.
 String getRootElementName()
          Returns the root element name.
 String getRootElementNamespace()
          Returns the root element namespace.
 String getSchemaResource()
          Returns the schema resource.
 Map<String,ConfigurationEventTypeXMLDOM.XPathPropertyDesc> getXPathProperties()
          Returns a map of property name and descriptor for XPath-expression properties.
 void setDefaultNamespace(String defaultNamespace)
          Sets the default namespace.
 void setRootElementName(String rootElementName)
          Sets the root element name.
 void setRootElementNamespace(String rootElementNamespace)
          Sets the root element namespace.
 void setSchemaResource(String schemaResource)
          Sets the schema resource.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationEventTypeXMLDOM

public ConfigurationEventTypeXMLDOM()
Ctor.

Method Detail

getRootElementName

public String getRootElementName()
Returns the root element name.

Returns:
root element name

setRootElementName

public void setRootElementName(String rootElementName)
Sets the root element name.

Parameters:
rootElementName - is the name of the root element

getRootElementNamespace

public String getRootElementNamespace()
Returns the root element namespace.

Returns:
root element namespace

setRootElementNamespace

public void setRootElementNamespace(String rootElementNamespace)
Sets the root element namespace.

Parameters:
rootElementNamespace - is the namespace for the root element

getDefaultNamespace

public String getDefaultNamespace()
Returns the default namespace.

Returns:
default namespace

setDefaultNamespace

public void setDefaultNamespace(String defaultNamespace)
Sets the default namespace.

Parameters:
defaultNamespace - is the default namespace

getSchemaResource

public String getSchemaResource()
Returns the schema resource.

Returns:
schema resource

setSchemaResource

public void setSchemaResource(String schemaResource)
Sets the schema resource.

Parameters:
schemaResource - is the schema resource

getXPathProperties

public Map<String,ConfigurationEventTypeXMLDOM.XPathPropertyDesc> getXPathProperties()
Returns a map of property name and descriptor for XPath-expression properties.

Returns:
XPath property information

addXPathProperty

public void addXPathProperty(String name,
                             String xpath,
                             QName type)
Adds an event property for which the engine uses the supplied XPath expression against a DOM document node to resolve a property value.

Parameters:
name - of the event property
xpath - is an arbitrary xpath expression
type - is a constant obtained from javax.xml.xpath.XPathConstants. Typical values are XPathConstants.NUMBER, STRING and BOOLEAN.

getNamespacePrefixes

public Map<String,String> getNamespacePrefixes()
Returns the namespace prefixes in a map of prefix as key and namespace name as value.

Returns:
namespace prefixes

addNamespacePrefix

public void addNamespacePrefix(String prefix,
                               String namespace)
Add a prefix and namespace name for use in XPath expressions refering to that prefix.

Parameters:
prefix - is the prefix of the namespace
namespace - is the namespace name

equals

public boolean equals(Object otherObj)
Overrides:
equals in class Object