|
||||||||||
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
org.pentaho.reporting.engine.classic.core.filter.DateFormatFilter
public class DateFormatFilter
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.
DateFormat
,
Serialized FormConstructor Summary | |
---|---|
DateFormatFilter()
Default constructor. |
Method Summary | |
---|---|
DateFormat |
getDateFormat()
Returns the date format object. |
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. |
Object |
getRawValue(ExpressionRuntime runtime,
Element element)
Returns the unformated raw value. |
Object |
getValue(ExpressionRuntime runtime,
Element element)
Returns the formatted string. |
void |
setDateFormat(DateFormat format)
Sets the date format for the filter. |
void |
setFormatter(Format format)
Sets the formatter. |
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.FormatFilter |
---|
clone, getDataSource, getFormatter, getNullValue, setDataSource, setNullValue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DateFormatFilter()
Method Detail |
---|
public DateFormat getDateFormat()
public void setDateFormat(DateFormat format)
format
- The format.
NullPointerException
- if the format given is nullpublic void setFormatter(Format format)
setFormatter
in class FormatFilter
format
- The format.
ClassCastException
- if the format given is no DateFormat
NullPointerException
- if the format given is nullpublic Object getRawValue(ExpressionRuntime runtime, Element element)
RawDataSource
Number
or Date
objects is a good idea.
getRawValue
in interface RawDataSource
getRawValue
in class FormatFilter
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of
this filter.
public Object getValue(ExpressionRuntime runtime, Element element)
FormatFilter
getValue
in interface DataSource
getValue
in class FormatFilter
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of
this filter.element
- the element for which the data is computed.
public FormatSpecification getFormatString(ExpressionRuntime runtime, Element element, FormatSpecification formatSpecification)
RawDataSource
FormatSpecification.TYPE_UNDEFINED
in that case.
getFormatString
in interface RawDataSource
getFormatString
in class FormatFilter
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 |