org.deegree.filter.expression
Class Literal<V extends TypedObjectNode>

java.lang.Object
  extended by org.deegree.filter.expression.Literal<V>
Type Parameters:
V - type of the contained value, in most cases PrimitiveValue
All Implemented Interfaces:
Expression

public class Literal<V extends TypedObjectNode>
extends Object
implements Expression

Expression that has a constant value.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.deegree.filter.Expression
Expression.Type
 
Constructor Summary
Literal(String value)
           
Literal(V value, QName type)
          Creates a new Literal instance.
 
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.
 QName getTypeName()
          Returns the name of the value type.
 V getValue()
          Returns the literal's value.
 String toString(String indent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Literal

public Literal(String value)

Literal

public Literal(V value,
               QName type)
Creates a new Literal instance.

Parameters:
value - value of the literal
type - name of the type, can be null
Method Detail

getValue

public V getValue()
Returns the literal's value.

Returns:
the literal's value

getTypeName

public QName getTypeName()
Returns the name of the value type.

Returns:
the name of the value type, can be null (no explicit type information available)

getType

public Expression.Type getType()
Description copied from interface: Expression
Returns the type of expression. Use this to safely determine the subtype of Expression.

Specified by:
getType in interface Expression
Returns:
type of expression

evaluate

public <T> TypedObjectNode[] evaluate(T obj,
                                      XPathEvaluator<T> xpathEvaluator)
Description copied from interface: Expression
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.

Specified by:
evaluate in interface Expression
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

toString

public String toString(String indent)
Specified by:
toString in interface Expression

getParams

public Expression[] getParams()
Description copied from interface: Expression
Returns the expression's paramters.

Specified by:
getParams in interface Expression
Returns:
the parameters of the expression


Copyright © 2011. All Rights Reserved.