public class StringFieldTemplate extends AbstractTemplate implements RawDataSource
Constructor and Description |
---|
StringFieldTemplate()
Creates a new string field template.
|
Modifier and Type | Method and Description |
---|---|
StringFieldTemplate |
clone()
Clones the template.
|
protected DataRowDataSource |
getDataRowDataSource()
Returns the datarow data source used in this template.
|
String |
getField()
Returns the field name.
|
FormatSpecification |
getFormatString(ExpressionRuntime runtime,
ReportElement element,
FormatSpecification formatSpecification)
Returns information about the formatstring that was used to transform a raw-value into a formatted text.
|
String |
getFormula()
Returns the formula used to compute the value of the data source.
|
String |
getNullValue()
Returns the value displayed by the field when the data source value is
null . |
Object |
getRawValue(ExpressionRuntime runtime,
ReportElement element)
Returns the unformated raw value.
|
Object |
getValue(ExpressionRuntime runtime,
ReportElement element)
Returns the current value for the data source.
|
void |
setField(String field)
Sets the field name.
|
void |
setFormula(String formula)
Defines the formula used to compute the value of this data source.
|
void |
setNullValue(String nullValue)
Sets the value displayed by the field when the data source value is
null . |
getInstance, getName, setName
public StringFieldTemplate()
public String getField()
public void setField(String field)
field
- the field name.public String getFormula()
public void setFormula(String formula)
formula
- the formula for the data source.public String getNullValue()
null
.null
.public void setNullValue(String nullValue)
null
.nullValue
- the value that represents null
.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 StringFieldTemplate clone() throws CloneNotSupportedException
clone
in interface DataSource
clone
in class AbstractTemplate
CloneNotSupportedException
- this should never happen.protected DataRowDataSource getDataRowDataSource()
public Object getRawValue(ExpressionRuntime runtime, ReportElement element)
RawDataSource
Number
or Date
objects is a good idea.getRawValue
in interface RawDataSource
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of this
filter.public FormatSpecification getFormatString(ExpressionRuntime runtime, ReportElement element, FormatSpecification formatSpecification)
RawDataSource
.classic.core.filter.FormatSpecification#TYPE_UNDEFINED
in that case.getFormatString
in interface RawDataSource
runtime
- the Expression runtime used to possibly compute the raw-value.element
- the element to which this datasource is added.formatSpecification
- the format specification (can be null). @return a filled format specififcation. If the
formatSpecification
parameter was not null, this given instance is reused.Copyright © 2002–2017 Pentaho Corporation. All rights reserved.