com.espertech.esperio.representation.axiom
Class ConfigurationEventTypeAxiom

java.lang.Object
  extended by com.espertech.esperio.representation.axiom.ConfigurationEventTypeAxiom
All Implemented Interfaces:
com.espertech.esper.util.MetaDefItem, java.io.Serializable

public class ConfigurationEventTypeAxiom
extends java.lang.Object
implements com.espertech.esper.util.MetaDefItem, java.io.Serializable

Configuration object for enabling the engine to process events represented as Axiom OMNode document nodes.

Use this class to configure the engine for processing of Axiom OMNode 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 EPL 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.

See Also:
Serialized Form

Nested Class Summary
static class ConfigurationEventTypeAxiom.XPathPropertyDesc
          Descriptor class for event properties that are resolved via XPath-expression.
 
Constructor Summary
ConfigurationEventTypeAxiom()
          Ctor.
 
Method Summary
 void addNamespacePrefix(java.lang.String prefix, java.lang.String namespace)
          Add a prefix and namespace name for use in XPath expressions refering to that prefix.
 void addXPathProperty(java.lang.String name, java.lang.String xpath, javax.xml.namespace.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.
 void addXPathProperty(java.lang.String name, java.lang.String xpath, javax.xml.namespace.QName type, java.lang.String castToType)
          Adds an event property for which the engine uses the supplied XPath expression against a DOM document node to resolve a property value.
 java.lang.String getDefaultNamespace()
          Returns the default namespace.
 java.util.Map<java.lang.String,java.lang.String> getNamespacePrefixes()
          Returns the namespace prefixes in a map of prefix as key and namespace name as value.
 java.lang.String getRootElementName()
          Returns the root element name.
 java.lang.String getRootElementNamespace()
          Returns the root element namespace.
 java.util.Map<java.lang.String,ConfigurationEventTypeAxiom.XPathPropertyDesc> getXPathProperties()
          Returns a map of property name and descriptor for XPath-expression properties.
 boolean isResolvePropertiesAbsolute()
          Indicates whether properties are compiled into absolute or deep XPath expressions (see setter method for more detail).
 void setDefaultNamespace(java.lang.String defaultNamespace)
          Sets the default namespace.
 void setResolvePropertiesAbsolute(boolean resolvePropertiesAbsolute)
          When set to true (the default), indicates that when properties are compiled to XPath expressions that the compilation should generate an absolute XPath expression such as "/getQuote/request" for the simple request property, or "/getQuote/request/symbol" for a "request.symbol" nested property, wherein the root element node is "getQuote".
 void setRootElementName(java.lang.String rootElementName)
          Sets the root element name.
 void setRootElementNamespace(java.lang.String rootElementNamespace)
          Sets the root element namespace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigurationEventTypeAxiom

public ConfigurationEventTypeAxiom()
Ctor.

Method Detail

getRootElementName

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

Returns:
root element name

setRootElementName

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

Parameters:
rootElementName - is the name of the root element

getRootElementNamespace

public java.lang.String getRootElementNamespace()
Returns the root element namespace.

Returns:
root element namespace

setRootElementNamespace

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

Parameters:
rootElementNamespace - is the namespace for the root element

getDefaultNamespace

public java.lang.String getDefaultNamespace()
Returns the default namespace.

Returns:
default namespace

setDefaultNamespace

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

Parameters:
defaultNamespace - is the default namespace

getXPathProperties

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

Returns:
XPath property information

addXPathProperty

public void addXPathProperty(java.lang.String name,
                             java.lang.String xpath,
                             javax.xml.namespace.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.

addXPathProperty

public void addXPathProperty(java.lang.String name,
                             java.lang.String xpath,
                             javax.xml.namespace.QName type,
                             java.lang.String castToType)
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.
castToType - is the type name of the type that the return value of the xpath expression is casted to

getNamespacePrefixes

public java.util.Map<java.lang.String,java.lang.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(java.lang.String prefix,
                               java.lang.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

isResolvePropertiesAbsolute

public boolean isResolvePropertiesAbsolute()
Indicates whether properties are compiled into absolute or deep XPath expressions (see setter method for more detail).

Returns:
true for absolute properties, false for deep properties

setResolvePropertiesAbsolute

public void setResolvePropertiesAbsolute(boolean resolvePropertiesAbsolute)
When set to true (the default), indicates that when properties are compiled to XPath expressions that the compilation should generate an absolute XPath expression such as "/getQuote/request" for the simple request property, or "/getQuote/request/symbol" for a "request.symbol" nested property, wherein the root element node is "getQuote".

When set to false, indicates that when properties are compiled to XPath expressions that the compilation should generate a deep XPath expression such as "//symbol" for the simple symbol property, or "//request/symbol" for a "request.symbol" nested property.

Parameters:
resolvePropertiesAbsolute - true for absolute XPath for properties (default), false for deep XPath

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