|
||||||||||
| 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 DataSourceruntime - 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 DataTargetpublic void setDataSource(DataSource ds)
setDataSource in interface DataTargetds - the data source.
public Object clone()
throws CloneNotSupportedException
clone in interface DataSourceclone in interface DataTargetclone in class ObjectCloneNotSupportedException - this should never happen.
public Object getRawValue(ExpressionRuntime runtime,
Element element)
RawDataSourceNumber or Date objects is a good idea.
getRawValue in interface RawDataSourceruntime - 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)
RawDataSourceFormatSpecification.TYPE_UNDEFINED
in that case.
getFormatString in interface RawDataSourceruntime - 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 | |||||||||