public class DateFieldTemplate extends AbstractTemplate implements RawDataSource
Constructor and Description |
---|
DateFieldTemplate()
Creates a new date field template.
|
Modifier and Type | Method and Description |
---|---|
DateFieldTemplate |
clone()
Clones this template.
|
protected DataRowDataSource |
getDataRowDataSource()
Returns the data-row datasource.
|
protected SimpleDateFormatFilter |
getDateFilter()
Returns the date filter.
|
SimpleDateFormat |
getDateFormat()
Returns the date formatter.
|
String |
getField()
Returns the field name.
|
String |
getFormat()
Returns the date format string.
|
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 string that represents
null values. |
Object |
getRawValue(ExpressionRuntime runtime,
ReportElement element)
Returns the unformated raw value.
|
protected StringFilter |
getStringFilter()
Returns the string filter.
|
Object |
getValue(ExpressionRuntime runtime,
ReportElement element)
Returns the current value for the data source.
|
void |
setDateFormat(SimpleDateFormat dateFormat)
Sets the date formatter.
|
void |
setField(String field)
Sets the field name.
|
void |
setFormat(String format)
Sets the date format string.
|
void |
setFormula(String formula)
Defines the formula used to compute the value of this data source.
|
void |
setNullValue(String nullValue)
Sets the string that represents
null values. |
getInstance, getName, setName
public String getFormat()
public void setFormat(String format)
format
- the format string.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
values.public void setNullValue(String nullValue)
null
values.nullValue
- the string that represents null
values.public SimpleDateFormat getDateFormat()
public void setDateFormat(SimpleDateFormat dateFormat)
dateFormat
- the date formatter.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 DateFieldTemplate clone() throws CloneNotSupportedException
clone
in interface DataSource
clone
in class AbstractTemplate
CloneNotSupportedException
- this should never happen.protected SimpleDateFormatFilter getDateFilter()
protected DataRowDataSource getDataRowDataSource()
protected StringFilter getStringFilter()
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.