Class StaticDataSource
- java.lang.Object
-
- 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
Constructors Constructor Description StaticDataSource()
Default constructor.StaticDataSource(Object o)
Constructs a new static data source.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StaticDataSource
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, ReportElement element)
Returns the value of the data source.void
setValue(Object o)
Sets the value of the data source.
-
-
-
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, ReportElement element)
Returns the value of the data source.- Specified by:
getValue
in interfaceDataSource
- 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 StaticDataSource clone() throws CloneNotSupportedException
Clones the data source, although the enclosed 'static' value is not cloned.- Specified by:
clone
in interfaceDataSource
- Overrides:
clone
in classObject
- Returns:
- a clone.
- Throws:
CloneNotSupportedException
- this should never happen.
-
-