org.apache.ws.resource.properties.query
Interface ExpressionEvaluator

All Known Implementing Classes:
AbstractXPathExpressionEvaluator

public interface ExpressionEvaluator

An ExpressionEvaluator is used to implement a query expression evaluation of a ResourcePropertySet. An evaluator can be registered with a QueryEngine, which in turn calls the evaluator when a matching expression is found.

See Also:
ResourcePropertySet, QueryEngine

Method Summary
 java.lang.Object evaluate(QueryExpression queryExpr, java.lang.Object evalContext)
          Evaluates the expression over the specified context object and returns the result.
 java.lang.Object evaluate(QueryExpression queryExpr, ResourcePropertySet resourcePropertySet)
          Evaluates the expression over a ResourcePropertySet and returns the result.
 java.net.URI[] getSupportedDialects()
          Gets the list of dialects that this evaluator can handle.
 

Method Detail

getSupportedDialects

public java.net.URI[] getSupportedDialects()
Gets the list of dialects that this evaluator can handle.

Returns:
list of dialects supported by this evaluator.

evaluate

public java.lang.Object evaluate(QueryExpression queryExpr,
                                 ResourcePropertySet resourcePropertySet)
                          throws UnknownQueryExpressionDialectException,
                                 QueryEvaluationErrorException,
                                 InvalidQueryExpressionException
Evaluates the expression over a ResourcePropertySet and returns the result.

Parameters:
queryExpr - the query expression to evaluate
resourcePropertySet - a WSRF resource property set to be used as the evaluation context
Returns:
the result of the evaluation which depends on the expression. The results must be an xml serializable object in order to be passed back correctly to a remote client. The easiest way of achieving this is to model it as a Bean, or simply return a SOAPElment or DOM Element. If the result object returned is null an empty query result is returned.
Throws:
UnknownQueryExpressionDialectException - if query dialect is unsupported
QueryEvaluationErrorException - if query evaluation fails
InvalidQueryExpressionException - if query expression is invalid

evaluate

public java.lang.Object evaluate(QueryExpression queryExpr,
                                 java.lang.Object evalContext)
                          throws UnknownQueryExpressionDialectException,
                                 QueryEvaluationErrorException,
                                 InvalidQueryExpressionException
Evaluates the expression over the specified context object and returns the result. Implementations that do not need to evaluate query expressions against contexts other than resource property sets may choose not to implement this method.

Parameters:
queryExpr - the query expression to evaluate
evalContext - the XPath evaluation context; can be any object that represents an XML InfoSet item (e.g. a DOM Node
Returns:
the result of the evaluation which depends on the expression. The results must be an xml serializable object in order to be passed back correctly to a remote client. The easiest way of achieving this is to model it as a Bean, or simply return a SOAPElment or DOM Element. If the result object returned is null an empty query result is returned.
Throws:
UnknownQueryExpressionDialectException - if query dialect is unsupported
QueryEvaluationErrorException - if query evaluation fails
InvalidQueryExpressionException - if query expression is invalid


Copyright © 2004-2005 Apache Software Foundation. All Rights Reserved.