com.jrefinery.report.filter
Class DateFormatFilter

java.lang.Object
  |
  +--com.jrefinery.report.filter.FormatFilter
        |
        +--com.jrefinery.report.filter.DateFormatFilter
All Implemented Interfaces:
java.lang.Cloneable, DataFilter, DataSource, DataTarget, java.io.Serializable
Direct Known Subclasses:
SimpleDateFormatFilter

public class DateFormatFilter
extends FormatFilter

A filter that creates string from dates. This filter will format java.util. Date objects using a java.text.DateFormat to create the string representation for the date obtained from the datasource.

If the object read from the datasource is no date, the NullValue defined by setNullValue(Object) is returned.

Author:
Thomas Morgner
See Also:
DateFormat, Serialized Form

Constructor Summary
DateFormatFilter()
          Default constructor.
 
Method Summary
 java.text.DateFormat getDateFormat()
          Returns the date format object.
 void setDateFormat(java.text.DateFormat format)
          Sets the date format for the filter.
 void setFormatter(java.text.Format format)
          Sets the formatter.
 
Methods inherited from class com.jrefinery.report.filter.FormatFilter
clone, getDataSource, getFormatter, getNullValue, getValue, setDataSource, setNullValue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateFormatFilter

public DateFormatFilter()
Default constructor. Creates a new filter using the default date format for the current locale.

Method Detail

getDateFormat

public java.text.DateFormat getDateFormat()
Returns the date format object.

Returns:
The date format object.

setDateFormat

public void setDateFormat(java.text.DateFormat format)
Sets the date format for the filter.

Parameters:
format - The format.
Throws:
java.lang.NullPointerException - if the format given is null

setFormatter

public void setFormatter(java.text.Format format)
Sets the formatter.

Overrides:
setFormatter in class FormatFilter
Parameters:
format - The format.
Throws:
java.lang.ClassCastException - if the format given is no DateFormat
java.lang.NullPointerException - if the format given is null