public class SimpleDateFormatFilter extends DateFormatFilter
SimpleDateFormat
,
Serialized FormConstructor and Description |
---|
SimpleDateFormatFilter()
DefaultConstructor.
|
Modifier and Type | Method and Description |
---|---|
String |
getFormatString()
Returns the formatString for this SimpleDateFormat.
|
FormatSpecification |
getFormatString(ExpressionRuntime runtime,
ReportElement element,
FormatSpecification formatSpecification)
Returns information about the formatstring that was used to transform a raw-value into a formatted text.
|
String |
getLocalizedFormatString()
Returns a localized formatString for this SimpleDateFormat.
|
SimpleDateFormat |
getSimpleDateFormat()
Returns the SimpleDateFormat object used in this filter.
|
Object |
getValue(ExpressionRuntime runtime,
ReportElement element)
Returns the formatted string.
|
boolean |
isKeepState()
Defines, whether the filter should keep its state, if a locale change is detected.
|
void |
setFormatString(String format)
defines the formatString for this SimpleDateFormat.
|
void |
setFormatter(Format format)
Sets the date format for the filter.
|
void |
setKeepState(boolean keepState)
Defines, whether the filter should keep its state, if a locale change is detected.
|
void |
setLocalizedFormatString(String format)
defines the localized formatString for this SimpleDateFormat.
|
void |
setSimpleDateFormat(SimpleDateFormat format)
Sets the date format for the filter.
|
getDateFormat, getRawValue, setDateFormat
clone, getDataSource, getFormatter, getNullValue, setDataSource, setNullValue
public SimpleDateFormat getSimpleDateFormat()
public void setSimpleDateFormat(SimpleDateFormat format)
format
- The format.NullPointerException
- if the format given is nullpublic void setFormatter(Format format)
setFormatter
in class DateFormatFilter
format
- The format.NullPointerException
- if the format given is nullClassCastException
- if the format given is no DateFormatpublic String getFormatString()
SimpleDateFormat
public void setFormatString(String format)
format
- the formatStringIllegalArgumentException
- if the string is invalidpublic String getLocalizedFormatString()
SimpleDateFormat
public void setLocalizedFormatString(String format)
format
- the formatStringIllegalArgumentException
- if the string is invalidpublic boolean isKeepState()
public void setKeepState(boolean keepState)
keepState
- set to true, if the locale should not update the DateSymbols, false otherwise.public Object getValue(ExpressionRuntime runtime, ReportElement element)
getValue
in interface DataSource
getValue
in class DateFormatFilter
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of this
filter.element
- public FormatSpecification getFormatString(ExpressionRuntime runtime, ReportElement element, FormatSpecification formatSpecification)
RawDataSource
.classic.core.filter.FormatSpecification#TYPE_UNDEFINED
in that case.getFormatString
in interface RawDataSource
getFormatString
in class DateFormatFilter
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.