Package com.espertech.esper.view

Examples of com.espertech.esper.view.ViewParameterException


    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);
View Full Code Here


    {
        ExprNode[] validated = ViewFactorySupport.validate("Correlation view", parentEventType, statementContext, viewParameters, false);
        String errorMessage = "Regression view requires two expressions providing x and y values as properties";

        if (validated.length < 2) {
            throw new ViewParameterException(errorMessage);
        }
        if ((!JavaClassHelper.isNumeric(validated[0].getExprEvaluator().getType())) || (!JavaClassHelper.isNumeric(validated[1].getExprEvaluator().getType())))
        {
            throw new ViewParameterException(errorMessage);
        }

        expressionX = validated[0];
        expressionY = validated[1];
View Full Code Here

{
    public void setViewParameters(ViewFactoryContext viewFactoryContext, List<ExprNode> expressionParameters) throws ViewParameterException
    {
        if (expressionParameters.size() != 1) {
            String errorMessage = getViewName() + " view requires a single expression as a parameter";
            throw new ViewParameterException(errorMessage);
        }
        expiryExpression = expressionParameters.get(0);
    }
View Full Code Here

   */
  protected void processKeywords(Object keywords, String errorMessage) throws ViewParameterException {

    if (!(keywords instanceof String))
    {
        throw new ViewParameterException(errorMessage);
    }

    String[] keyword = ((String) keywords).split(",");
    for (int i = 0; i < keyword.length; i++)
    {
        String keywordText = keyword[i].toLowerCase().trim();
        if (keywordText.length() == 0)
        {
            continue;
        }
        if (keywordText.equals(FORCE_UPDATE_KEYWORD))
        {
            isForceUpdate = true;
        }
        else if (keywordText.equals(START_EAGER_KEYWORD))
        {
            isForceUpdate = true;
            isStartEager = true;
        }
        else
        {
            String keywordRange = FORCE_UPDATE_KEYWORD + "," + START_EAGER_KEYWORD;
            throw new ViewParameterException("Time-length-combination view encountered an invalid keyword '" + keywordText + "', valid control keywords are: " + keywordRange);
        }
    }
  }
View Full Code Here

    public void attach(EventType parentEventType, StatementContext statementContext, ViewFactory optionalParentFactory, List<ViewFactory> parentViewFactories) throws ViewParameterException
    {
        ExprNode[] validated = ViewFactorySupport.validate(getViewName(), parentEventType, statementContext, viewParameters, true);

        if (validated.length < 2) {
            throw new ViewParameterException(getViewParamMessage());
        }
        if ((!JavaClassHelper.isNumeric(validated[0].getExprEvaluator().getType())) || (!JavaClassHelper.isNumeric(validated[1].getExprEvaluator().getType())))
        {
            throw new ViewParameterException(getViewParamMessage());
        }

        expressionX = validated[0];
        expressionY = validated[1];
View Full Code Here

TOP

Related Classes of com.espertech.esper.view.ViewParameterException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.