public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewParameterException
{
ExprNode[] validated = ViewFactorySupport.validate("Univariate statistics", parentEventType, statementContext, viewParameters, false);
String errorMessage = "Univariate statistics view require a single expression returning a numeric value as a parameter";
if (validated.length < 1) {
throw new ViewParameterException(errorMessage);
}
if (!JavaClassHelper.isNumeric(validated[0].getExprEvaluator().getType()))
{
throw new ViewParameterException(errorMessage);
}
fieldExpression = validated[0];
additionalProps = StatViewAdditionalProps.make(validated, 1);
eventType = UnivariateStatisticsView.createEventType(statementContext, additionalProps, streamNumber);