deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.filterencoding
Class Literal

java.lang.Object
  extended by org.deegree.model.filterencoding.Expression
      extended by org.deegree.model.filterencoding.Literal

public class Literal
extends Expression

Encapsulates the information of a element as defined in the FeatureId DTD.

Version:
07.08.2002
Author:
Markus Schneider

Field Summary
 
Fields inherited from class org.deegree.model.filterencoding.Expression
id
 
Constructor Summary
Literal(String value)
          Constructs a new Literal.
 
Method Summary
static Expression buildFromDOM(Element element)
          Given a DOM-fragment, a corresponding Expression-object is built.
 Object evaluate(Feature feature)
          Returns the Literal's value (to be used in the evaluation of a complexer Expression).
 String getValue()
          Returns the literal's value (as String).
 void setValue(String value)
           
 StringBuffer toXML()
          Produces an indented XML representation of this object.
 
Methods inherited from class org.deegree.model.filterencoding.Expression
getExpressionId, getExpressionName
 
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)
Constructs a new Literal.

Parameters:
value -
Method Detail

buildFromDOM

public static Expression buildFromDOM(Element element)
                               throws FilterConstructionException
Given a DOM-fragment, a corresponding Expression-object is built. This method recursively calls other buildFromDOM () - methods to validate the structure of the DOM-fragment.

Parameters:
element -
Throws:
FilterConstructionException - if the structure of the DOM-fragment is invalid

getValue

public String getValue()
Returns the literal's value (as String).

Returns:
the literal's value (as String).

setValue

public void setValue(String value)
Parameters:
value -
See Also:
getValue()

toXML

public StringBuffer toXML()
Produces an indented XML representation of this object.

Specified by:
toXML in class Expression
Returns:
XML representation of this object.

evaluate

public Object evaluate(Feature feature)
Returns the Literal's value (to be used in the evaluation of a complexer Expression). If the value appears to be numerical, a Double is returned, else a String. TODO: Improve datatype handling.

Specified by:
evaluate in class Expression
Parameters:
feature - that determines the values of PropertyNames in the expression (no use here)
Returns:
the resulting value

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org