org.pentaho.reporting.engine.classic.core.filter
Class StaticDataSource

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.filter.StaticDataSource
All Implemented Interfaces:
Serializable, Cloneable, DataSource

public class StaticDataSource
extends Object
implements DataSource

A data source that returns a constant value. An example is a label on a report.

Author:
Thomas Morgner
See Also:
Serialized Form

Constructor Summary
StaticDataSource()
          Default constructor.
StaticDataSource(Object o)
          Constructs a new static data source.
 
Method Summary
 Object clone()
          Clones the data source, although the enclosed 'static' value is not cloned.
 Object getValue()
          Returns the value set in this datasource.
 Object getValue(ExpressionRuntime runtime, Element element)
          Returns the value of the data source.
 void setValue(Object o)
          Sets the value of the data source.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticDataSource

public StaticDataSource()
Default constructor.


StaticDataSource

public StaticDataSource(Object o)
Constructs a new static data source.

Parameters:
o - The value.
Method Detail

setValue

public void setValue(Object o)
Sets the value of the data source.

Parameters:
o - The value.

getValue

public Object getValue()
Returns the value set in this datasource. This method exists to make the value-property beanified.

Returns:
the value.

getValue

public Object getValue(ExpressionRuntime runtime,
                       Element element)
Returns the value of the data source.

Specified by:
getValue in interface DataSource
Parameters:
runtime - the expression runtime that is used to evaluate formulas and expressions when computing the value of this filter.
element -
Returns:
The value.

clone

public Object clone()
             throws CloneNotSupportedException
Clones the data source, although the enclosed 'static' value is not cloned.

Specified by:
clone in interface DataSource
Overrides:
clone in class Object
Returns:
a clone.
Throws:
CloneNotSupportedException - this should never happen.