|
||||||||||
| 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.FormatFilter
public class FormatFilter
The base class for filters that format data. Data is received from a DataSource and formatted. The data source might be a field in the TableModel or a report function, or even another format filter (since filters implement the DataSource interface).
Formating is done by a java.text.Format object. This filter will always return a String object on getValue(). If the formater does not understand the object returned by the defined datasource, the defined null value is returned. The nullValue is set to "-" by default.
| Constructor Summary | |
|---|---|
FormatFilter()
Default constructor. |
|
| Method Summary | |
|---|---|
Object |
clone()
Clones the filter. |
DataSource |
getDataSource()
Returns the data source for the 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. |
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,
Element element)
Returns the unformated raw value. |
Object |
getValue(ExpressionRuntime runtime,
Element element)
Returns the formatted string. |
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FormatFilter()
| Method Detail |
|---|
public void setFormatter(Format format)
format - The format.
NullPointerException - if the given format is nullpublic Format getFormatter()
public Object getValue(ExpressionRuntime runtime,
Element element)
getValue in interface DataSourceruntime - 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 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 | |||||||||