public AggregationMultiFunctionMethodDesc ValidateAggregationMethod( ExprValidationContext validationContext, String aggMethodName, ExprNode[] @params) { aggMethodName = aggMethodName.ToLowerInvariant(); if ((aggMethodName == "countevents") || (aggMethodName == "listreference")) { if (@params.Length > 0) { throw new ExprValidationException("Invalid number of parameters"); } var provider = typeof(AggregationMethodLinearCount); var result = typeof(int?); if (aggMethodName == "listreference") { provider = typeof(AggregationMethodLinearListReference); result = typeof(IList<EventBean>); } return new AggregationMultiFunctionMethodDesc(new AggregationMethodLinearNoParamForge(provider, result), null, null, null); } var methodType = AggregationAccessorLinearTypeExtensions.FromString(aggMethodName); if (methodType == AggregationAccessorLinearType.FIRST || methodType == AggregationAccessorLinearType.LAST) { return HandleMethodFirstLast(@params, methodType.Value, validationContext); } else { return HandleMethodWindow(@params, validationContext); } }
public bool IsAggregationMethod( string name, ExprNode[] parameters, ExprValidationContext validationContext) { name = name.ToLowerInvariant(); return AggregationAccessorLinearTypeExtensions.FromString(name) != null || (name == "countevents") || (name == "listreference"); }