de.unidu.is.expressions
Class PlainExpression

java.lang.Object
  extended byde.unidu.is.expressions.AbstractExpression
      extended byde.unidu.is.expressions.PlainExpression
All Implemented Interfaces:
Expression

public class PlainExpression
extends AbstractExpression

An expression for plain content.

Since:
2003-10-21
Version:
$Revision: 1.7 $, $Date: 2005/03/14 17:33:14 $
Author:
Henrik Nottelmann

Field Summary
protected  java.lang.String content
          The content of this expression.
 
Constructor Summary
PlainExpression(java.lang.String content)
          Creates a new expression object.
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests whether this expressions equals the specified PlainExpression.
 int hashCode()
          Returns the hashcode of this expression object.
 void set(java.lang.String content)
          Sets the content of this expression.
 Expression substitute(java.util.Map binding)
          Performs an substitution for variables, e.g. for each key variable in the specified binding, all occurences of ${key} are replaced by the corresponding value in the map.
 java.lang.String toString()
          Returns the content of this expression.
 
Methods inherited from class de.unidu.is.expressions.AbstractExpression
getSQLTemplate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

content

protected java.lang.String content
The content of this expression.

Constructor Detail

PlainExpression

public PlainExpression(java.lang.String content)
Creates a new expression object.

Parameters:
content - expression content
Method Detail

equals

public boolean equals(java.lang.Object o)
Tests whether this expressions equals the specified PlainExpression.

Parameters:
o - expression to test
Returns:
true iff both expressions are equal

toString

public java.lang.String toString()
Returns the content of this expression.

Returns:
content of this expression

hashCode

public int hashCode()
Returns the hashcode of this expression object.

Returns:
hashcode of this expression object

substitute

public Expression substitute(java.util.Map binding)
Performs an substitution for variables, e.g. for each key variable in the specified binding, all occurences of ${key} are replaced by the corresponding value in the map.

How the substitution is managed is left to the implementing class. It is explicitly allowed to return a new expression object.

Specified by:
substitute in interface Expression
Overrides:
substitute in class AbstractExpression
Parameters:
binding - variable binding
Returns:
expression after substitution

set

public void set(java.lang.String content)
Sets the content of this expression.

Parameters:
content - new content