|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.pentaho.reporting.engine.classic.core.filter.StringFilter
public class StringFilter
A filter that returns the value from a data source as a String. The value is converted to an String using String.valueOf () which uses Object.toString() to convert the object into the string.
You can specify a default string to return when the value from the data source isnull
. Initially the
string 'null' is used.
Constructor Summary | |
---|---|
StringFilter()
Default constructor. |
Method Summary | |
---|---|
Object |
clone()
Clones the filter. |
DataSource |
getDataSource()
Returns the data source for this filter. |
FormatSpecification |
getFormatString(ExpressionRuntime runtime,
Element 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,
Element element)
Returns the unformated raw value. |
Object |
getValue(ExpressionRuntime runtime,
Element 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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringFilter()
Method Detail |
---|
public void setNullValue(String nullvalue)
nullvalue
- the null value.public String getNullValue()
public Object getValue(ExpressionRuntime runtime, Element 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 Object 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, Element 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, Element element, FormatSpecification formatSpecification)
RawDataSource
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |