com.sysord.mad.evaluator
Interface QueryEvaluator


public interface QueryEvaluator

Interface for all Query Evaluators.


Method Summary
 QueryAnalyze analyzeQuery(QueryEvaluationContext evaluationContext)
          Analyzes the query without evaluation for syntax validation and discovering return type information.
<T> QueryResult<T>
evaluate(QueryEvaluationContext evaluationContext)
          Evaluate a query using the QueryEvaluationContext
 java.lang.String getLanguageId()
          Returns the evaluator language id.
 java.text.MessageFormat getVariableFormat()
          Returns a MessageFormat for creating a variable name conform to the evaluator language syntax.
<T> QueryResult<T>
runActionQuery(QueryEvaluationContext evaluationContext)
          Execute an action query using the QueryEvaluationContext.
 

Method Detail

getLanguageId

java.lang.String getLanguageId()
Returns the evaluator language id.

Returns:
the evaluator language id

analyzeQuery

QueryAnalyze analyzeQuery(QueryEvaluationContext evaluationContext)
                          throws QueryEvaluatorException
Analyzes the query without evaluation for syntax validation and discovering return type information.

because this method is not used at this time, its implementation can returns null.

Parameters:
evaluationContext -
Returns:
the QueryAnalyze result for this analyze
Throws:
QueryEvaluatorException

getVariableFormat

java.text.MessageFormat getVariableFormat()
Returns a MessageFormat for creating a variable name conform to the evaluator language syntax.

Returns:
the MessageFormat for creating a variable name conform to the evaluator language syntax.

evaluate

<T> QueryResult<T> evaluate(QueryEvaluationContext evaluationContext)
                        throws QueryEvaluatorException
Evaluate a query using the QueryEvaluationContext

Parameters:
evaluationContext -
Returns:
the QueryResult
Throws:
QueryEvaluatorException

runActionQuery

<T> QueryResult<T> runActionQuery(QueryEvaluationContext evaluationContext)
                              throws QueryEvaluatorException
Execute an action query using the QueryEvaluationContext. Action query is a query that can change model state (create, update, add/remove element etc.).

Parameters:
evaluationContext -
Returns:
an QueryResult or null depending on the action implementation.
Throws:
QueryEvaluatorException