org.rhq.enterprise.server.resource.group.definition.framework
Class ExpressionEvaluator

java.lang.Object
  extended by org.rhq.enterprise.server.resource.group.definition.framework.ExpressionEvaluator
All Implemented Interfaces:
Iterable<ExpressionEvaluator.Result>

public class ExpressionEvaluator
extends Object
implements Iterable<ExpressionEvaluator.Result>


Nested Class Summary
 class ExpressionEvaluator.Result
           
 
Constructor Summary
ExpressionEvaluator()
           
 
Method Summary
 ExpressionEvaluator addExpression(String expression)
           
 void execute()
           
 String getComputedJPQLGroupStatement()
           
 String getComputedJPQLStatement()
           
 Iterator<ExpressionEvaluator.Result> iterator()
           
 void setTestMode(boolean mode)
           
 List<String> tokenizeCondition(String condition)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionEvaluator

public ExpressionEvaluator()
Method Detail

setTestMode

public void setTestMode(boolean mode)
Parameters:
mode - passing a value of true will bypass query later and only compute the effective JPQL statements, handy for testing

addExpression

public ExpressionEvaluator addExpression(String expression)
                                  throws InvalidExpressionException
Parameters:
expression - a string in the form of 'condition = value' or 'groupBy condition'
Returns:
a reference to itself, so that method chaining can be used
Throws:
InvalidExpressionException - if the expression can not be parsed for any reason, the message will try to get the details as to the parse failure

getComputedJPQLStatement

public String getComputedJPQLStatement()
Returns:
the JPQL statement that will be sent to the database, assuming test mode is false (the default): -- if no groupBy expressions are present, it will query for the target object -- if at least one groupBy expression was used, it will return the query to find the pivot data

getComputedJPQLGroupStatement

public String getComputedJPQLGroupStatement()
Returns:
the JPQL statement that will be sent to the database, assuming test mode is false (the default): -- if no groupBy expressions are present, this will return "" -- if at least one groupBy expression was used, it will return the pivoted query

execute

public void execute()

iterator

public Iterator<ExpressionEvaluator.Result> iterator()
Specified by:
iterator in interface Iterable<ExpressionEvaluator.Result>

tokenizeCondition

public List<String> tokenizeCondition(String condition)


Copyright © 2008-2012 Red Hat, Inc.. All Rights Reserved.