|
||||||||||
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.FormatParser
org.pentaho.reporting.engine.classic.core.filter.NumberFormatParser
org.pentaho.reporting.engine.classic.core.filter.DecimalFormatParser
public class DecimalFormatParser
A filter that parses string values from a data source to a number using the decimal numeric system as base.
This filter will parse strings using a java.text.DecimalFormat to create the numeric value for the string from the datasource. If the datasource does not return a string, the required string is formed by applying String.valueOf (Object). If the string read from the datasource could not be parsed into a number, the NullValue defined by setNullValue(Object) is returned.
NumberFormat
,
Number
,
Serialized FormConstructor Summary | |
---|---|
DecimalFormatParser()
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. |
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.NumberFormatParser |
---|
getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberFormat, isGroupingUsed, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setNumberFormat |
Methods inherited from class org.pentaho.reporting.engine.classic.core.filter.FormatParser |
---|
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 DecimalFormatParser()
Method Detail |
---|
public DecimalFormat getDecimalFormat()
public void setDecimalFormat(DecimalFormat format)
format
- the format.
NullPointerException
- if the given format is null.public void setFormatter(Format format)
setFormatter
in class NumberFormatParser
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 FormatParser
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of
this filter.element
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |