com.espertech.esper.epl.rettype
Class EPTypeHelper

java.lang.Object
  extended by com.espertech.esper.epl.rettype.EPTypeHelper

public class EPTypeHelper
extends java.lang.Object

Carries return type information related to the return values returned by expressions.

Use factory methods to initialize return type information according to the return values that your expression is going to provide.

  1. Use collectionOfEvents(com.espertech.esper.client.EventType) to indicate that the expression returns a collection of events.
  2. Use singleEvent(com.espertech.esper.client.EventType) to indicate that the expression returns a single event.
  3. Use collectionOfSingleValue(Class) to indicate that the expression returns a collection of single values. A single value can be any object including null.
  4. Use array(Class) to indicate that the expression returns an array of single values. A single value can be any object including null.
  5. Use singleValue(Class) to indicate that the expression returns a single value. A single value can be any object including null. Such expression results cannot be used as input to enumeration methods, for example.

.


Constructor Summary
EPTypeHelper()
           
 
Method Summary
static EPType array(java.lang.Class arrayComponentType)
          Indicate that the expression return type is an array of a given component type.
static EPType collectionOfEvents(EventType eventTypeOfCollectionEvents)
          Indicate that the expression return type is a collection of a given type of events.
static EPType collectionOfSingleValue(java.lang.Class collectionComponentType)
          Indicate that the expression return type is a collection of a given component type.
static EPType fromMethod(java.lang.reflect.Method method)
          Interrogate the provided method and determine whether it returns single-value, array of single-value or collection of single-value and their component type.
static java.lang.Class getClassMultiValued(EPType type)
           
static java.lang.Class getClassSingleValued(EPType type)
           
static EventType getEventType(EPType epType)
           
static EventType getEventTypeMultiValued(EPType type)
           
static EventType getEventTypeSingleValued(EPType type)
           
static java.lang.Class getNormalizedClass(EPType theType)
           
static boolean isCarryEvent(EPType epType)
           
static EPType nullValue()
           
static EPType optionalFromEnumerationExpr(java.lang.String statementId, EventAdapterService eventAdapterService, ExprNode exprNode)
           
static java.lang.Class optionalIsComponentTypeColl(EPType type)
           
static EventType optionalIsEventTypeColl(EPType type)
           
static EventType optionalIsEventTypeSingle(EPType type)
           
static EPType singleEvent(EventType eventTypeOfSingleEvent)
          Indicate that the expression return type is single event of a given event type.
static EPType singleValue(java.lang.Class singleValueType)
          Indicate that the expression return type is a single (non-enumerable) value of the given type.
static java.lang.String toTypeDescriptive(EPType epType)
          Returns a nice text detailing the expression result type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EPTypeHelper

public EPTypeHelper()
Method Detail

getEventTypeSingleValued

public static EventType getEventTypeSingleValued(EPType type)

getEventTypeMultiValued

public static EventType getEventTypeMultiValued(EPType type)

getClassMultiValued

public static java.lang.Class getClassMultiValued(EPType type)

getClassSingleValued

public static java.lang.Class getClassSingleValued(EPType type)

isCarryEvent

public static boolean isCarryEvent(EPType epType)

getEventType

public static EventType getEventType(EPType epType)

array

public static EPType array(java.lang.Class arrayComponentType)
Indicate that the expression return type is an array of a given component type.

Parameters:
arrayComponentType - array component type
Returns:
array of single value expression result type

singleValue

public static EPType singleValue(java.lang.Class singleValueType)
Indicate that the expression return type is a single (non-enumerable) value of the given type. The expression can still return an array or collection or events however since the engine would not know the type of such objects and may not use runtime reflection it may not allow certain operations on expression results.

Parameters:
singleValueType - type of single value returned, or null to indicate that the expression always returns null
Returns:
single-value expression result type

nullValue

public static EPType nullValue()

collectionOfSingleValue

public static EPType collectionOfSingleValue(java.lang.Class collectionComponentType)
Indicate that the expression return type is a collection of a given component type.

Parameters:
collectionComponentType - collection component type
Returns:
collection of single value expression result type

collectionOfEvents

public static EPType collectionOfEvents(EventType eventTypeOfCollectionEvents)
Indicate that the expression return type is a collection of a given type of events.

Parameters:
eventTypeOfCollectionEvents - the event type of the events that are part of the collection
Returns:
collection of events expression result type

singleEvent

public static EPType singleEvent(EventType eventTypeOfSingleEvent)
Indicate that the expression return type is single event of a given event type.

Parameters:
eventTypeOfSingleEvent - the event type of the event returned
Returns:
single-event expression result type

fromMethod

public static EPType fromMethod(java.lang.reflect.Method method)
Interrogate the provided method and determine whether it returns single-value, array of single-value or collection of single-value and their component type.

Parameters:
method - the class methods
Returns:
expression return type

toTypeDescriptive

public static java.lang.String toTypeDescriptive(EPType epType)
Returns a nice text detailing the expression result type.

Returns:
descriptive text

getNormalizedClass

public static java.lang.Class getNormalizedClass(EPType theType)

optionalFromEnumerationExpr

public static EPType optionalFromEnumerationExpr(java.lang.String statementId,
                                                 EventAdapterService eventAdapterService,
                                                 ExprNode exprNode)
                                          throws ExprValidationException
Throws:
ExprValidationException

optionalIsEventTypeColl

public static EventType optionalIsEventTypeColl(EPType type)

optionalIsComponentTypeColl

public static java.lang.Class optionalIsComponentTypeColl(EPType type)

optionalIsEventTypeSingle

public static EventType optionalIsEventTypeSingle(EPType type)

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