net.esper.filter
Class FilterSpecCompiler

java.lang.Object
  extended by net.esper.filter.FilterSpecCompiler

public final class FilterSpecCompiler
extends Object

Helper to compile (validate and optimize) filter expressions as used in pattern and filter-based streams.


Field Summary
static String PROPERTY_NAME_BOOLEAN_EXPRESSION
          Assigned for filter parameters that are based on boolean expression and not on any particular property name.
 
Constructor Summary
FilterSpecCompiler()
           
 
Method Summary
protected static FilterSpecParam makeFilterParam(ExprNode constituent)
          For a given expression determine if this is optimizable and create the filter parameter representing the expression, or null if not optimizable.
static FilterSpecCompiled makeFilterSpec(EventType eventType, List<ExprNode> filterExpessions, LinkedHashMap<String,EventType> taggedEventTypes, StreamTypeService streamTypeService, AutoImportService autoImportService)
          Factory method for compiling filter expressions into a filter specification for use with filter service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_NAME_BOOLEAN_EXPRESSION

public static final String PROPERTY_NAME_BOOLEAN_EXPRESSION
Assigned for filter parameters that are based on boolean expression and not on any particular property name.

Keeping this artificial property name is a simplification as optimized filter parameters generally keep a property name.

See Also:
Constant Field Values
Constructor Detail

FilterSpecCompiler

public FilterSpecCompiler()
Method Detail

makeFilterSpec

public static FilterSpecCompiled makeFilterSpec(EventType eventType,
                                                List<ExprNode> filterExpessions,
                                                LinkedHashMap<String,EventType> taggedEventTypes,
                                                StreamTypeService streamTypeService,
                                                AutoImportService autoImportService)
                                         throws ExprValidationException
Factory method for compiling filter expressions into a filter specification for use with filter service.

Parameters:
eventType - is the filtered-out event type
filterExpessions - is a list of filter expressions
taggedEventTypes - is a map of stream names (tags) and event types available
streamTypeService - is used to set rules for resolving properties
autoImportService - resolved imports for static methods and such
Returns:
compiled filter specification
Throws:
ExprValidationException - if the expression or type validations failed

makeFilterParam

protected static FilterSpecParam makeFilterParam(ExprNode constituent)
                                          throws ExprValidationException
For a given expression determine if this is optimizable and create the filter parameter representing the expression, or null if not optimizable.

Parameters:
constituent - is the expression to look at
Returns:
filter parameter representing the expression, or null
Throws:
ExprValidationException - if the expression is invalid