ExpressionCompiler expressionCompiler = new ExpressionCompiler( );
	public static boolean isValidExpressionInQueryFilter(			IBaseExpression expression )	{		if ( expression instanceof IScriptExpression )		{			String text = ( (IScriptExpression) expression ).getText( );			Context context = Context.enter( );			// fake a registry to register the aggragation.			AggregateRegistry aggrReg = new AggregateRegistry( ) {				public int register( AggregateExpression aggregationExpr )				{					return -1;				}			};			try			{				CompiledExpression expr = expressionCompiler.compile( text,						aggrReg,						context );				return flattenFilterExpression( expr );			}			finally			{				Context.exit( );			}		}		else if ( expression instanceof IConditionalExpression )		{			IScriptExpression expr = ( (IConditionalExpression) expression ).getExpression( );			IScriptExpression oprand1 = ( (IConditionalExpression) expression ).getOperand1( );			IScriptExpression oprand2 = ( (IConditionalExpression) expression ).getOperand2( );			return isValidExpressionInQueryFilter( expr )					&& isValidExpressionInQueryFilter( oprand1 )					&& isValidExpressionInQueryFilter( oprand2 );		}		return true;	}