|
||||||||||
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
public class FormatParser
A format parser tries to parse a string into an object. If the value returned by the datasource is no string, a string is formed using String.valueOf (Object). This string is fed into the java.text.Format of this FormatParser and the parsed object is returned.
What class of object is returned, is determined by the given format. If parsing failed, the defined NullValue is returned.
Constructor Summary | |
---|---|
FormatParser()
DefaultConstructor. |
Method Summary | |
---|---|
Object |
clone()
Clones the parser. |
DataSource |
getDataSource()
Returns the data source for the filter. |
Format |
getFormatter()
Returns the format for the filter. |
Object |
getNullValue()
Returns the object representing a null value from the data source. |
Object |
getValue(ExpressionRuntime runtime,
Element element)
Returns the parsed object. |
void |
setDataSource(DataSource ds)
Sets the data source. |
void |
setFormatter(Format format)
Sets the format for the filter. |
void |
setNullValue(Object nullvalue)
Sets the value that will be displayed if the data source supplies a null value. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FormatParser()
Method Detail |
---|
public void setFormatter(Format format)
format
- The format.
NullPointerException
- if the given format is nullpublic Format getFormatter()
public Object getValue(ExpressionRuntime runtime, Element element)
getValue
in interface DataSource
runtime
- the expression runtime that is used to evaluate formulas and expressions when computing the value of
this filter.element
-
public DataSource getDataSource()
getDataSource
in interface DataTarget
public void setDataSource(DataSource ds)
setDataSource
in interface DataTarget
ds
- The data source.public void setNullValue(Object nullvalue)
nullvalue
- The value returned when the parsing failed.public Object getNullValue()
public Object clone() throws CloneNotSupportedException
clone
in interface DataSource
clone
in interface DataTarget
clone
in class Object
CloneNotSupportedException
- this should never happen.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |