public class StringFilter extends Object implements DataFilter, RawDataSource
null
. Initially the
string 'null' is used.Constructor and Description |
---|
StringFilter()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
StringFilter |
clone()
Clones the filter.
|
DataSource |
getDataSource()
Returns the data source for this 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.
|
String |
getNullValue()
Returns the string used to represent a null value.
|
Object |
getRawValue(ExpressionRuntime runtime,
ReportElement element)
Returns the unformated raw value.
|
Object |
getValue(ExpressionRuntime runtime,
ReportElement element)
Returns the value obtained from the data source.
|
void |
setDataSource(DataSource ds)
Sets the data source for this filter.
|
void |
setNullValue(String nullvalue)
Sets the string used to represent a null value.
|
public void setNullValue(String nullvalue)
nullvalue
- the null value.public String getNullValue()
public Object getValue(ExpressionRuntime runtime, ReportElement element)
The filter ensures that the returned value is a String, even though the return type is Object (as required by the DataSource interface).
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 DataSource getDataSource()
getDataSource
in interface DataTarget
public void setDataSource(DataSource ds)
setDataSource
in interface DataTarget
ds
- the data source.public StringFilter 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.