public class DataRowDataSource extends Object implements DataSource
TableModel
, plus the current values of the defined expressions and functions for the report.
The DataRowDataSource can either query the data-row directly using the specified field name or it can evaluate a
given formula (which must be compatible to the OpenFormula specifications) to compute the value.
Fields and formulas are mutually exclusive; defining a field name autmatically undefines the formula and vice versa.DataRow
,
Serialized FormConstructor and Description |
---|
DataRowDataSource()
Default constructor.
|
DataRowDataSource(String column)
Constructs a new data source.
|
Modifier and Type | Method and Description |
---|---|
DataRowDataSource |
clone()
Clones the data source.
|
String |
getDataSourceColumnName()
Returns the data source column name.
|
String |
getField()
Deprecated.
Required for legacy-parsing, do not use elsewhere.
|
String |
getFormula()
Returns the formula used to compute the value of the data source.
|
Object |
getValue(ExpressionRuntime runtime,
ReportElement element)
Returns the current value of the data source, obtained from a particular column in the data-row.
|
void |
setDataSourceColumnName(String dataSourceColumnName)
Defines the name of the column in the datarow to be queried.
|
void |
setField(String field)
Deprecated.
Required for legacy-parsing, do not use elsewhere.
|
void |
setFormula(String formula)
Defines the formula used to compute the value of this data source.
|
public DataRowDataSource()
public DataRowDataSource(String column)
column
- the name of the field, function or expression in the data-row.public String getField()
public void setField(String field)
field
- public String getDataSourceColumnName()
public void setDataSourceColumnName(String dataSourceColumnName)
dataSourceColumnName
- the name of the column in the datarow to be queried.NullPointerException
- if the name is null
.DataRow.get(java.lang.String)
public String getFormula()
public void setFormula(String formula)
formula
- the formula for the data source.public Object getValue(ExpressionRuntime runtime, ReportElement element)
getValue
in interface DataSource
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of this
filter.element
- public DataRowDataSource clone() throws CloneNotSupportedException
clone
in interface DataSource
clone
in class Object
CloneNotSupportedException
- if the cloning is not supported.Copyright © 2017 Hitachi Vantara. All rights reserved.