public static ExprNode[] validate(String viewName,EventType eventType,StatementContext statementContext,List<ExprNode> expressions,boolean allowConstantResult) throws ViewParameterException {
  List<ExprNode> results=new ArrayList<ExprNode>();
  int expressionNumber=0;
  StreamTypeService streamTypeService=new StreamTypeServiceImpl(eventType,null,false,statementContext.getEngineURI());
  for (  ExprNode expr : expressions) {
    ExprNode validated=validateExpr(viewName,statementContext,expr,streamTypeService,expressionNumber);
    results.add(validated);
    if ((!allowConstantResult) && (validated.isConstantResult())) {
      String message="Invalid view parameter expression " + expressionNumber + getViewDesc(viewName)+ ", the expression returns a constant result value, are you sure?";
      log.error(message);
      throw new ViewParameterException(message);
    }
    expressionNumber++;
  }
  return results.toArray(new ExprNode[results.size()]);
}

public static ExprNode [ ] validate ( String viewName , EventType eventType , StatementContext statementContext , List < ExprNode > expressions , boolean allowConstantResult ) throws ViewParameterException { List < ExprNode > results = new ArrayList < ExprNode > ( ) ; int expressionNumber = 0 ; StreamTypeService streamTypeService = new StreamTypeServiceImpl ( eventType , null , false , statementContext . getEngineURI ( ) ) ; for ( ExprNode expr : expressions ) { ExprNode validated = validateExpr ( viewName , statementContext , expr , streamTypeService , expressionNumber ) ; results . add ( validated ) ; if ( ( ! allowConstantResult ) && ( validated . isConstantResult ( ) ) ) { String message = "Invalid view parameter expression " + expressionNumber + getViewDesc ( viewName ) + ", the expression returns a constant result value, are you sure?" ; log . error ( message ) ; throw new ViewParameterException ( message ) ; } expressionNumber ++ ; } return results . toArray ( new ExprNode [ results . size ( ) ] ) ; }
validate the view parameter expressions and return the validated expression for later execution . < p > does not evaluate the expression .
