org.deegree.filter
Interface Expression

All Known Subinterfaces:
CustomExpression
All Known Implementing Classes:
AbstractCustomExpression, Add, Categorize, ChangeCase, Concatenate, Div, FormatDate, FormatNumber, Function, Interpolate, Literal, Mul, Recode, StringLength, StringPosition, Sub, Substring, Trim, ValueReference

public interface Expression

An Expression describes a rule to obtain a value that may be derived from the properties of an object.

Note that the objects returned by evaluate(Object, XPathEvaluator) is an TypedObjectNode[], as an expression may evaluate to multiple values, e.g. a ValueReference that targets a multi property of a feature. Values in the returned array may also be null.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$

Nested Class Summary
static class Expression.Type
          Convenience enum type for discriminating the different expression types.
 
Method Summary
<T> TypedObjectNode[]
evaluate(T obj, XPathEvaluator<T> xpathEvaluator)
          Determines the values of the expression for the given context object.
 Expression[] getParams()
          Returns the expression's paramters.
 Expression.Type getType()
          Returns the type of expression.
 String toString(String indent)
           
 

Method Detail

getType

Expression.Type getType()
Returns the type of expression. Use this to safely determine the subtype of Expression.

Returns:
type of expression

evaluate

<T> TypedObjectNode[] evaluate(T obj,
                               XPathEvaluator<T> xpathEvaluator)
                           throws FilterEvaluationException
Determines the values of the expression for the given context object.

Note that this returns an TypedObjectNode[], as an expression may evaluate to multiple values, e.g. a ValueReference that targets a multi property of a feature.

Type Parameters:
T - type of the context object
Parameters:
obj - object that the expression is evaluated upon, must not be null
xpathEvaluator - used for evaluation of XPath expressions, must not be null
Returns:
the values of the expression, may be empty (and even contain null values), but never null
Throws:
FilterEvaluationException

getParams

Expression[] getParams()
Returns the expression's paramters.

Returns:
the parameters of the expression

toString

String toString(String indent)


Copyright © 2011. All Rights Reserved.