|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jrefinery.report.filter.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 | |
java.lang.Object |
clone()
Clones the filter. |
DataSource |
getDataSource()
Returns the data source for the filter. |
java.text.Format |
getFormatter()
Returns the format for the filter. |
java.lang.String |
getNullValue()
Returns the string representing a null value from the data source. |
java.lang.Object |
getValue()
Returns the formatted string. |
void |
setDataSource(DataSource ds)
Sets the data source. |
void |
setFormatter(java.text.Format format)
Sets the format for the filter. |
void |
setNullValue(java.lang.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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FormatFilter()
| Method Detail |
public void setFormatter(java.text.Format format)
format - The format.
java.lang.NullPointerException - if the given format is nullpublic java.text.Format getFormatter()
public java.lang.Object getValue()
If format, datasource or object are null, the NullValue is returned.
getValue in interface DataSourcepublic void setNullValue(java.lang.String nullvalue)
nullvalue - The string.public java.lang.String getNullValue()
public DataSource getDataSource()
getDataSource in interface DataTargetpublic void setDataSource(DataSource ds)
setDataSource in interface DataTargetds - The data source.
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in interface DataSourcejava.lang.CloneNotSupportedException - this should never happen.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||