|
||||||||||
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.NumberFormatFilter
org.pentaho.reporting.engine.classic.core.filter.DecimalFormatFilter
public class DecimalFormatFilter
A filter that formats the numeric value from a data source to a string representation using the decimal number system as base.
This filter will format java.lang.Number objects using a java.text.DecimalFormat 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.
NumberFormat
,
Number
,
Serialized FormConstructor Summary | |
---|---|
DecimalFormatFilter()
DefaultConstructor, this object is initialized using a DecimalFormat with the default pattern for this locale. |
Method Summary | |
---|---|
DecimalFormat |
getDecimalFormat()
Returns the format for the filter. |
String |
getFormatString()
Synthesizes a pattern string that represents the current state of this 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. |
String |
getLocalizedFormatString()
Synthesizes a localized pattern string that represents the current state of this Format object. |
Object |
getValue(ExpressionRuntime runtime,
Element element)
Returns the formatted string. |
boolean |
isKeepState()
Defines, whether the filter should keep its state, if a locale change is detected. |
void |
setDecimalFormat(DecimalFormat format)
Sets the format for the filter. |
void |
setFormatString(String format)
Applies a format string to the internal DecimalFormat instance. |
void |
setFormatter(Format format)
Sets the 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)
Applies a localised format string to the internal DecimalFormat instance. |
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.NumberFormatFilter |
---|
getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberFormat, isGroupingUsed, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setNumberFormat |
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.FormatFilter |
---|
clone, getDataSource, getFormatter, getNullValue, getRawValue, setDataSource, setNullValue |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DecimalFormatFilter()
Method Detail |
---|
public DecimalFormat getDecimalFormat()
NullPointerException
- if the given format is nullpublic void setDecimalFormat(DecimalFormat format)
format
- the format.
NullPointerException
- if the given format is nullpublic void setFormatter(Format format)
setFormatter
in class NumberFormatFilter
format
- the format.
NullPointerException
- if the given format is null
ClassCastException
- if the format is no decimal formatpublic String getFormatString()
public void setFormatString(String format)
DecimalFormat
instance.
format
- the format string.public String getLocalizedFormatString()
public void setLocalizedFormatString(String format)
DecimalFormat
instance.
format
- the format string.public 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, Element element)
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
-
public FormatSpecification getFormatString(ExpressionRuntime runtime, Element element, FormatSpecification formatSpecification)
RawDataSource
FormatSpecification.TYPE_UNDEFINED
in that case.
getFormatString
in interface RawDataSource
getFormatString
in class NumberFormatFilter
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 |