public class FormatFilter extends Object implements DataFilter, RawDataSource
Constructor and Description |
---|
FormatFilter()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
FormatFilter |
clone()
Clones the filter.
|
DataSource |
getDataSource()
Returns the data source for the filter.
|
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.
|
Format |
getFormatter()
Returns the format for the filter.
|
String |
getNullValue()
Returns the string representing a null value from the data source.
|
Object |
getRawValue(ExpressionRuntime runtime,
ReportElement element)
Returns the unformated raw value.
|
Object |
getValue(ExpressionRuntime runtime,
ReportElement element)
Returns the formatted string.
|
protected void |
invalidateCache()
Clears all cached values and forces a complete recomputation of all formattings.
|
void |
setDataSource(DataSource ds)
Sets the data source.
|
void |
setFormatter(Format format)
Sets the format for the filter.
|
void |
setNullValue(String nullvalue)
Sets the value that will be displayed if the data source supplies a null value.
|
protected void invalidateCache()
public void setFormatter(Format format)
format
- The format.NullPointerException
- if the given format is nullpublic Format getFormatter()
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 void setNullValue(String nullvalue)
nullvalue
- The string.public String getNullValue()
public DataSource getDataSource()
getDataSource
in interface DataTarget
public void setDataSource(DataSource ds)
setDataSource
in interface DataTarget
ds
- The data source.public FormatFilter clone() throws CloneNotSupportedException
clone
in interface DataSource
clone
in interface DataTarget
clone
in class Object
CloneNotSupportedException
- this should never happen.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 © 2017 Hitachi Vantara. All rights reserved.